Changeset d2b2a7 in git
- Timestamp:
- May 5, 1998, 1:55:40 PM (25 years ago)
- Branches:
- (u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
- Children:
- 97f92aa6d280f6022eaae47195ccc02503ccb984
- Parents:
- 4996f5286c7671191ad22e654499fd8b752fe4f0
- Location:
- Singular
- Files:
-
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/classify.lib
r4996f52 rd2b2a7 1 // $Id: classify.lib,v 1.2 2 1998-04-22 09:13:07krueger Exp $2 /////////////////////////////////////////////////////////////////////////////// 3 4 version = "$Id: classify.lib,v 1.2 2 1998-04-22 09:13:07krueger Exp $";1 // $Id: classify.lib,v 1.23 1998-05-05 11:55:20 krueger Exp $ 2 /////////////////////////////////////////////////////////////////////////////// 3 4 version = "$Id: classify.lib,v 1.23 1998-05-05 11:55:20 krueger Exp $"; 5 5 info=" 6 6 LIBRARY: classify.lib PROCEDURES FOR THE ARNOLD-CLASSIFIER OF SINGULARITIES … … 52 52 53 53 proc classify (poly f_in) 54 USAGE: classify(f); f=poly54 "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 of57 differentiables maps, Volume I " by V.I. Arnold, S.M. Gusein-Zade,56 equivalence, as given in the book \"Singularities of 57 differentiables maps, Volume I\" by V.I. Arnold, S.M. Gusein-Zade, 58 58 A.N. Varchenko 59 59 RETURN: normal form of f, of type poly 60 60 REMARK: This version of classify is only alpha. Please send bugs and 61 comments to: "Kai Krueger" <krueger@mathematik.uni-kl.de>61 comments to: \"Kai Krueger\" <krueger@mathematik.uni-kl.de> 62 62 Be sure to have at least Singular version 0.9.3, better 1.0.1 63 63 Updates can be found under: … … 68 68 with @, hence there should be no name conflicts 69 69 EXAMPLE: example classify; shows an example 70 " 70 71 { 71 72 //---------------------------- initialisation --------------------------------- … … 1279 1280 /////////////////////////////////////////////////////////////////////////////// 1280 1281 proc tschirnhaus (poly f, poly x) 1281 USAGE: tschirnhaus(); 1282 "USAGE: tschirnhaus(); 1283 " 1282 1284 { 1283 1285 //---------------------------- initialisation --------------------------------- … … 1523 1525 /////////////////////////////////////////////////////////////////////////////// 1524 1526 proc morsesplit(poly f) 1527 " 1525 1528 USAGE: morsesplit(f); f=poly 1526 1529 RETURN: Normal form of f in M^3 after application of the splitting lemma 1527 1530 COMPUTE: apply the splitting lemma (generalized Morse lemma) to f 1528 1531 EXAMPLE: example morsesplit; shows an example 1532 " 1529 1533 { 1530 1534 //---------------------------- initialisation --------------------------------- … … 1770 1774 1771 1775 /////////////////////////////////////////////////////////////////////////////// 1772 proc quickclass(poly f); 1776 proc quickclass(poly f) 1777 " 1773 1778 USAGE: quickclass(f); f=poly 1774 1779 RETURN: Normal form of f in Arnold's list … … 1777 1782 no coordinate change is needed (see also proc 'milnorcode'). 1778 1783 EXAMPLE: example quickclass; shows an example 1784 " 1779 1785 { 1780 1786 //---------------------------- initialisation --------------------------------- … … 1829 1835 /////////////////////////////////////////////////////////////////////////////// 1830 1836 proc milnorcode (poly f, list #) 1831 USAGE: milnorcode(f[,e]); f=poly, e=int1837 "USAGE: milnorcode(f[,e]); f=poly, e=int 1832 1838 RETURN: intvec, coding the Hilbert function of the e-th Milnor algebra 1833 1839 of f, i.e. of basering/(jacob(f)^e) (default e=1), according 1834 1840 to proc Hcode 1835 1841 EXAMPLE: example milnorcode; shows an example 1842 " 1836 1843 { 1837 1844 int e=1; … … 1852 1859 /////////////////////////////////////////////////////////////////////////////// 1853 1860 proc Hcode (intvec v) 1854 USAGE: Hcode(v); v=intvec1861 "USAGE: Hcode(v); v=intvec 1855 1862 RETURN: intvec, coding v according to the number of successive 1856 1863 repetitions of an entry 1857 1864 EXAMPLE: example Hcode; shows an example. 1865 " 1858 1866 { 1859 1867 int col, len, i, cur, cnt, maxcoef, nlen; … … 1942 1950 static 1943 1951 proc parity (int e) 1944 USAGE: parity() 1952 "USAGE: parity() 1953 " 1945 1954 { 1946 1955 int r = e/2; … … 2265 2274 /////////////////////////////////////////////////////////////////////////////// 2266 2275 proc singularity(string typ, list #) 2267 USAGE: singularity(t, l); t=string (name of singularity),2276 "USAGE: singularity(t, l); t=string (name of singularity), 2268 2277 l=list of integers (index/indices of singularity) 2269 2278 COMPUTE: get the Singularity named by type t from the database. … … 2276 2285 index (indices) l 2277 2286 EXAMPLE: example singularity; shows an example 2287 " 2278 2288 { 2279 2289 poly a1, a2, a3, a4, f; … … 2372 2382 /////////////////////////////////////////////////////////////////////////////// 2373 2383 proc RandomPolyK (int M, string Typ) 2374 USAGE: RandomPolyK(M, Typ) 2384 "USAGE: RandomPolyK(M, Typ) 2385 " 2375 2386 { 2376 2387 //---------------------------- initialisation --------------------------------- … … 2430 2441 /////////////////////////////////////////////////////////////////////////////// 2431 2442 proc debug_log (int level, list #) 2432 USAGE: debug_log(level,li); level=int, li=comma separated "message" list2433 COMPUTE: print "messages" if level>=@DeBug.2443 "USAGE: debug_log(level,li); level=int, li=comma separated \"message\" list 2444 COMPUTE: print \"messages\" if level>=@DeBug. 2434 2445 useful for user-defined trace messages. 2435 2446 EXAMPLE: example debug_log; shows an example 2436 2447 SEE ALSO: init_debug(); 2448 " 2437 2449 { 2438 2450 int len = size(#); … … 2455 2467 /////////////////////////////////////////////////////////////////////////////// 2456 2468 proc init_debug(list #) 2457 USAGE: init_debug([level]); level=int2469 "USAGE: init_debug([level]); level=int 2458 2470 COMPUTE: Set the global variable @DeBug to level. The variable @DeBug is 2459 2471 used by the function debug_log(level, list of strings) to know … … 2463 2475 range from 0 to 10, higher values of n give more information. 2464 2476 EXAMPLE: example init_debug; shows an example 2477 " 2465 2478 { 2466 2479 int newDebug=0; … … 2508 2521 /////////////////////////////////////////////////////////////////////////////// 2509 2522 proc basicinvariants(poly f) 2510 USAGE: basicinvariants(f); f = poly2523 "USAGE: basicinvariants(f); f = poly 2511 2524 COMPUTE: Compute basic invariants of f: an upper bound d for the 2512 2525 determinacy, the milnor number mu and the corank c of f 2513 2526 RETURN: intvec: d, mu, c 2514 2527 EXAMPLE: example basicinvariants; shows an example 2528 " 2515 2529 { 2516 2530 intvec v; … … 2530 2544 /////////////////////////////////////////////////////////////////////////////// 2531 2545 proc corank(poly f) 2532 USAGE: corank(f); f=poly2546 "USAGE: corank(f); f=poly 2533 2547 RETURN: the corank of the Hessian matrix of f, of type int 2534 2548 REMARK: corank(f) is the number of variables occuring in the residual 2535 2549 singulartity after applying 'morsesplit' to f 2536 2550 EXAMPLE: example corank; shows an example 2551 " 2537 2552 { 2538 2553 matrix M = jacob(jacob(jet(f,2))); … … 2612 2627 static 2613 2628 proc GetRf (poly fi, int n) 2614 USAGE: GetRf(); 2629 "USAGE: GetRf(); 2630 " 2615 2631 { 2616 2632 //---------------------------- initialisation --------------------------------- … … 2668 2684 static 2669 2685 proc DecodeNormalFormString (string S_in) 2670 USAGE: DecodeNormalFormString 2686 "USAGE: DecodeNormalFormString 2687 " 2671 2688 { 2672 2689 //---------------------------- initialisation --------------------------------- … … 2771 2788 /////////////////////////////////////////////////////////////////////////////// 2772 2789 proc A_L 2773 USAGE: A_L(f); f=poly2774 A_L( "name"); type=string2790 "USAGE: A_L(f); f=poly 2791 A_L(\"name\"); type=string 2775 2792 COMPUTE: the normal form in Arnold's list of the singularity given either 2776 2793 by a polynomial f or by its name. 2777 2794 RETURN: A_L(f): compute via 'milnorcode' the class of f and 2778 2795 return the normal form of f found in the database. 2779 A_L( "name"): Get the normal form from the database for2796 A_L(\"name\"): Get the normal form from the database for 2780 2797 the singularity given by its name. 2781 2798 EXAMPLE: example A_L; shows an example 2799 " 2782 2800 { 2783 2801 // if trace/debug mode not set, do it! … … 2804 2822 /////////////////////////////////////////////////////////////////////////////// 2805 2823 proc normalform(string s_in) 2806 USAGE: normalform(s); s=string2824 "USAGE: normalform(s); s=string 2807 2825 RETURN: Arnold's normal form of singularity with name s 2808 2826 EXAMPLE: example normalform; shows an example. 2827 " 2809 2828 { 2810 2829 string Typ; … … 2836 2855 /////////////////////////////////////////////////////////////////////////////// 2837 2856 proc swap 2838 USAGE: swap(a,b);2857 "USAGE: swap(a,b); 2839 2858 RETURN: b,a if b,a is the input (any type) 2859 " 2840 2860 { 2841 2861 return(#[2],#[1]); … … 2848 2868 /////////////////////////////////////////////////////////////////////////////// 2849 2869 proc Setring(int c, string name) 2850 USAGE: 2870 "USAGE: 2871 " 2851 2872 { 2852 2873 string s="ring "+name+"=0,(x(1.."+ string(c) +")),(c,ds);"; … … 2856 2877 /////////////////////////////////////////////////////////////////////////////// 2857 2878 proc internalfunctions 2858 USAGE: internalfunctions();2879 "USAGE: internalfunctions(); 2859 2880 RETURN: nothing, display names of internal procedures of classify.lib 2860 2881 EXAMPLE: no example 2882 " 2861 2883 { " Internal functions for the classification using Arnold's method,"; 2862 2884 " the function numbers correspond to numbers in Arnold's classifier:"; -
Singular/LIB/deform.lib
r4996f52 rd2b2a7 1 // $Id: deform.lib,v 1. 9 1998-05-03 14:09:50 obachmanExp $1 // $Id: deform.lib,v 1.10 1998-05-05 11:55:22 krueger Exp $ 2 2 // author: Bernd Martin email: martin@math.tu-cottbus.de 3 3 //(bm, last modified 4/98) 4 4 /////////////////////////////////////////////////////////////////////////////// 5 version="$Id: deform.lib,v 1. 9 1998-05-03 14:09:50 obachmanExp $";5 version="$Id: deform.lib,v 1.10 1998-05-05 11:55:22 krueger Exp $"; 6 6 info=" 7 7 LIBRARY: deform.lib PROCEDURES FOR COMPUTING MINIVERSAL DEFORMATION … … 30 30 /////////////////////////////////////////////////////////////////////////////// 31 31 proc versal (ideal Fo,list #) 32 USAGE: versal(Fo[,d,any]); Fo=ideal, d=int, any=list32 "USAGE: versal(Fo[,d,any]); Fo=ideal, d=int, any=list 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, 38 the ordering is the product between "ls" and "ord(Po)",38 the ordering is the product between \"ls\" and \"ord(Po)\", 39 39 'my'Qx = Px/Fo extending Qo=Po/Fo, 40 40 'my'So = being the embedding-ring of the versal base space, 41 'my'Ox = Px/Js extending So/Js. (default my= "")41 'my'Ox = Px/Js extending So/Js. (default my=\"\") 42 42 Matrices (in Px, exported): 43 43 Js = giving the versal base space (obstructions), … … 46 46 If d is defined (!=0), it computes up to degree d. 47 47 If 'any' is defined and any[1] is no string, interactive version. 48 Otherwise 'any' gives predefined strings: "my","param","order","out"49 ( "my" prefix-string, "param" is a letter (e.g. "A") for the name of50 first parameter or (e.g. "A(") for index parameter variables, "order"51 ordering string for ring extension), "out" name of output-file).48 Otherwise 'any' gives predefined strings: \"my\",\"param\",\"order\",\"out\" 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\" 51 ordering string for ring extension), \"out\" name of output-file). 52 52 NOTE: printlevel < 0 no output at all, 53 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 56 " 56 57 { 57 58 //------- prepare ------------------------------------------------------------- … … 303 304 /////////////////////////////////////////////////////////////////////////////// 304 305 proc mod_versal(matrix Mo, ideal I, list #) 305 306 " 306 307 USAGE: mod_versal(Mo,I[,d,any]); I=ideal, M=module, d=int, any =list 307 308 COMUPTE: miniversal deformation of coker(Mo) over Qo=Po/Io, Po=basering; … … 310 311 (deformation parameters), 311 312 the new variables come before the old ones, 312 the ordering is the product between "my_ord" and "ord(Po)",313 the ordering is the product between \"my_ord\" and \"ord(Po)\", 313 314 'my'Qx = Px/Io extending Qo (returns as basering), 314 315 'my'Ox = Px/(Io+Js) ring of the versal deformation of coker(Ms), 315 'my'So = embedding-ring of the versal base space. (default 'my'= "")316 'my'So = embedding-ring of the versal base space. (default 'my'=\"\") 316 317 Matrices (in Qx, exported): 317 318 Js = giving the versal base space (obstructions), … … 320 321 If d is defined (!=0), it computes up to degree d. 321 322 If 'any' is defined and any[1] is no string, interactive version. 322 Otherwise 'any' gives predefined strings: "my","param","order","out"323 ( "my" prefix-string, "param" is a letter (e.g. "A") for the name of324 first parameter or (e.g. "A(") for index parameter variables, "ord"325 ordering string for ringextension), "out" name of output-file).323 Otherwise 'any' gives predefined strings:\"my\",\"param\",\"order\",\"out\" 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\" 326 ordering string for ringextension), \"out\" name of output-file). 326 327 NOTE: printlevel < 0 no output at all, 327 328 printlevel >=0,1,2,.. informs you, what is going on, 328 329 this proc uses 'execute'. 329 330 EXAMPLE:example mod_versal; shows an example 331 " 330 332 { 331 333 //------- prepare ------------------------------------------------------------- … … 543 545 /////////////////////////////////////////////////////////////////////////////// 544 546 proc kill_rings(list #) 545 USAGE: kill_rings([string]);547 "USAGE: kill_rings([string]); 546 548 Sub-procedure: kills exported rings of 'versal' and 547 549 'mod_versal' with prefix 'string' 550 " 548 551 { 549 552 string my,br; … … 568 571 /////////////////////////////////////////////////////////////////////////////// 569 572 proc compute_ext(matrix Mo,int p) 570 573 " 571 574 Sub-procedure: obtain Ext1 and Ext2 and other objects used by mod_versal 575 " 572 576 { 573 577 int l,f0,f1,f2,f3,e1,e2,ok_ann; … … 624 628 ////////////////////////////////////////////////////////////////////////////// 625 629 proc get_rings(ideal Io,int e1,int switch, list #) 626 630 " 627 631 Sub-procedure: creating ring-extensions 632 " 628 633 { 629 634 def Po = basering; … … 659 664 } 660 665 ////////////////////////////////////////////////////////////////////////////// 661 proc get_inf_def(list #) ;662 666 proc get_inf_def(list #) 667 " 663 668 Sub-procedure: compute infinitesimal family of a module and its syzygies 664 669 from a kbase of Ext1 and its lifts 670 " 665 671 { 666 672 matrix Ms = #[1]; … … 684 690 ////////////////////////////////////////////////////////////////////////////// 685 691 proc lift_rel_kb (module N, module M, list #) 686 692 " 687 693 USAGE lift_rel_kb(N,M[,kbaseM,p]); 688 694 ASSUME [p a monomial ] or the product of all variables … … 694 700 i.e. kbaseM*A = reduce(N,std(M)) 695 701 EXAMPLE example lift_rel_kb; shows examples 702 " 696 703 { 697 704 poly p = product(maxideal(1)); … … 732 739 /////////////////////////////////////////////////////////////////////////////// 733 740 proc lift_kbase (N, M) 734 USAGE: lift_kbase(N,M); N,M=poly/ideal/vector/module741 "USAGE: lift_kbase(N,M); N,M=poly/ideal/vector/module 735 742 RETURN: matrix A, coefficient matrix expressing N as linear combination of 736 743 k-basis of M. Let the k-basis have k elements and size(N)=c columns. … … 740 747 block of the ordering is c or C 741 748 EXAMPLE: example lift_kbase; shows an example 749 " 742 750 { 743 751 return(lift_rel_kb(N,M)); … … 760 768 /////////////////////////////////////////////////////////////////////////////// 761 769 proc interact1 () 762 770 " 763 771 Sub_procedure: asking for and reading your input-strings 772 " 764 773 { 765 774 string my = "@"; … … 794 803 /////////////////////////////////////////////////////////////////////////////// 795 804 proc interact2 (matrix A, intvec col_vec, list #) 796 805 " 797 806 Sub-procedure: asking for and reading your input 807 " 798 808 { 799 809 module B,C; … … 825 835 /////////////////////////////////////////////////////////////////////////////// 826 836 proc negative_part(intvec iv) 827 837 " 828 838 RETURNS intvec of indices of jv having negative entries (or iv, if non) 839 " 829 840 { 830 841 intvec jv; … … 841 852 /////////////////////////////////////////////////////////////////////////////// 842 853 proc find_ord(matrix A, intvec w_vec) 843 854 " 844 855 Sub-proc: return martix ord(a_ij) with respect to weight_vec, or 845 856 0 if A non-qh 857 " 846 858 { 847 859 int @r = nrows(A); … … 865 877 ////////////////////////////////////////////////////////////////////////////////// 866 878 proc homog_test(intvec w_vec, matrix Mo, matrix A) 867 879 " 868 880 Sub proc: return relative weight string of columnes of A with respect 869 to the given w_vec and to Mo, or "" if not qh881 to the given w_vec and to Mo, or \"\" if not qh 870 882 NOTE: * means weight is not determined 883 " 871 884 { 872 885 int k,l; … … 902 915 ////////////////////////////////////////////////////////////////////////////////// 903 916 proc homog_t(intvec d_vec, matrix Fo, matrix A) 904 917 " 905 918 Sub-procedure: Computing relative (with respect to flatten(Fo)) weight_vec 906 919 of columnes of A (return zero if Fo or A not qh) 920 " 907 921 { 908 922 Fo = matrix(Fo,nrows(A),1); -
Singular/LIB/elim.lib
r4996f52 rd2b2a7 1 // $Id: elim.lib,v 1. 3 1998-04-03 22:47:00krueger Exp $1 // $Id: elim.lib,v 1.4 1998-05-05 11:55:22 krueger Exp $ 2 2 // system("random",787422842); 3 3 // (GMG, last modified 22.06.96) 4 4 /////////////////////////////////////////////////////////////////////////////// 5 5 6 version="$Id: elim.lib,v 1. 3 1998-04-03 22:47:00krueger Exp $";6 version="$Id: elim.lib,v 1.4 1998-05-05 11:55:22 krueger Exp $"; 7 7 info=" 8 8 LIBRARY: elim.lib PROCEDURES FOR ELIMINATIOM, SATURATION AND BLOWING UP … … 23 23 24 24 proc blowup0 (ideal j,list #) 25 USAGE: blowup0(j[,s1,s2]); j ideal, s1,s2 nonempty strings25 "USAGE: blowup0(j[,s1,s2]); j ideal, s1,s2 nonempty strings 26 26 CREATE: Create a presentation of the blowup ring of j 27 27 RETURN: no return value 28 28 NOTE: s1 and s2 are used to give names to the blownup ring and the blownup 29 ideal (default: s1= "j", s2="A")30 Assume R = char,x(1..n),ord is the basering of j, and s1= "j", s2="A"29 ideal (default: s1=\"j\", s2=\"A\") 30 Assume R = char,x(1..n),ord is the basering of j, and s1=\"j\", s2=\"A\" 31 31 then the procedure creates a new ring with name Bl_jR 32 32 (equal to R[A,B,...]) … … 34 34 with k=ncols(j) new variables A,B,... and ordering wp(d1..dk) if j is 35 35 homogeneous with deg(j[i])=di resp. dp otherwise for these vars. 36 If k>26 or size(s2)>1, say s2= "A()", the new vars are A(1),...,A(k).36 If k>26 or size(s2)>1, say s2=\"A()\", the new vars are A(1),...,A(k). 37 37 Let j_ be the kernel of the ring map Bl_jR -> R defined by A(i)->j[i], 38 38 x(i)->x(i), then the quotient ring Bl_jR/j_ is the blowup ring of j … … 42 42 DISPLAY: printlevel >=0: explain created objects (default) 43 43 EXAMPLE: example blowup0; shows examples 44 {44 "{ 45 45 string bsr = nameof(basering); 46 46 def br = basering; … … 100 100 101 101 proc elim (id, int n, int m) 102 USAGE: elim(id,n,m); id ideal/module, n,m integers102 "USAGE: elim(id,n,m); id ideal/module, n,m integers 103 103 RETURNS: ideal/module obtained from id by eliminating variables n..m 104 104 NOTE: no special monomial ordering is required, result is a SB with … … 107 107 This proc uses 'execute' or calls a procedure using 'execute'. 108 108 EXAMPLE: example elim; shows examples 109 " 109 110 { 110 111 //---- get variables to be eliminated and create string for new ordering ------ … … 137 138 138 139 proc elim1 (id, poly vars) 139 USAGE: elim1(id,poly); id ideal/module, poly=product of vars to be eliminated140 "USAGE: elim1(id,poly); id ideal/module, poly=product of vars to be eliminated 140 141 RETURN: ideal/module obtained from id by eliminating vars occuring in poly 141 142 NOTE: no special monomial ordering is required, result is a SB with … … 144 145 This proc uses 'execute' or calls a procedure using 'execute'. 145 146 EXAMPLE: example elim1; shows examples 147 " 146 148 { 147 149 //---- get variables to be eliminated and create string for new ordering ------ … … 175 177 176 178 proc nselect (id, int n, list#) 177 USAGE: nselect(id,n[,m]); id a module or ideal, n, m integers179 "USAGE: nselect(id,n[,m]); id a module or ideal, n, m integers 178 180 RETURN: generators of id not containing the variable n [up to m] 179 181 EXAMPLE: example nselect; shows examples 180 {182 "{ 181 183 int j,k; 182 184 if( size(#)==0 ) { #[1]=n; } … … 200 202 201 203 proc sat (id, ideal j) 202 USAGE: sat(id,j); id=ideal/module, j=ideal204 "USAGE: sat(id,j); id=ideal/module, j=ideal 203 205 RETURN: list of an ideal/module [1] and an integer [2]: 204 206 [1] = saturation of id with respect to j (= union_(k=1...) of id:j^k) … … 207 209 DISPLAY: saturation exponent during computation if printlevel >=1 208 210 EXAMPLE: example sat; shows an example 209 {211 "{ 210 212 int ii,kk; 211 213 def i=id; … … 240 242 241 243 proc select (id, int n, list#) 242 USAGE: select(id,n[,m]); id ideal/module, n, m integers244 "USAGE: select(id,n[,m]); id ideal/module, n, m integers 243 245 RETURN: generators of id containing the variable n [up to m] 244 246 EXAMPLE: example select; shows examples 245 {247 "{ 246 248 if( size(#)==0 ) { #[1]=n; } 247 249 int j,k; -
Singular/LIB/factor.lib
r4996f52 rd2b2a7 1 // $Id: factor.lib,v 1. 4 1998-04-03 22:47:01krueger Exp $1 // $Id: factor.lib,v 1.5 1998-05-05 11:55:23 krueger Exp $ 2 2 //(RS) 3 3 /////////////////////////////////////////////////////////////////////////////// 4 4 5 version="$Id: factor.lib,v 1. 4 1998-04-03 22:47:01krueger Exp $";5 version="$Id: factor.lib,v 1.5 1998-05-05 11:55:23 krueger Exp $"; 6 6 info=" 7 7 LIBRARY: factor.lib PROCEDURES FOR CALLING THE REDUCE FACTORIZER … … 14 14 15 15 proc delete_dollar ( string s ) 16 USAGE: delete_dollar(s); s = string16 "USAGE: delete_dollar(s); s = string 17 17 RETURN: string, with '$' replaced by ' ' 18 18 EXAMPLE: example delete_dollar; shows an example 19 " 19 20 { 20 21 while( s[size(s)]=="$" and size(s)!=1 ) { s=s[1,size(s)-1]; } … … 38 39 39 40 proc reduce_factor ( poly f ) 40 USAGE: reduce_factor(f); f = poly41 "USAGE: reduce_factor(f); f = poly 41 42 RETURN: list, the factors of f 42 43 NOTE: due to a limitation of REDUCE, multivariate polynomials can only … … 44 45 This proc runs under UNIX only 45 46 EXAMPLE: example reduce_factor; shows an example 47 " 46 48 { 47 49 string pid = string( system( "pid" ) ); -
Singular/LIB/fastsolv.lib
r4996f52 rd2b2a7 1 1 // 2 version="$Id: fastsolv.lib,v 1. 2 1998-04-03 22:47:01krueger Exp $";2 version="$Id: fastsolv.lib,v 1.3 1998-05-05 11:55:24 krueger Exp $"; 3 3 info=""; 4 4 … … 9 9 10 10 proc Tsimplify 11 USAGE: simplify(id,n); id ideal, n integer11 "USAGE: simplify(id,n); id ideal, n integer 12 12 RETURNS: list of two ideals the first containing the simplified 13 13 elements, the second the variables which already have … … 16 16 n+1,... is not supported 17 17 EXAMPLE: example simplify; shows an example 18 18 " 19 19 { 20 20 def bsr=basering; … … 88 88 89 89 proc simplifyInBadRings 90 USAGE: simplify(id,n); id ideal, n product of the variables90 "USAGE: simplify(id,n); id ideal, n product of the variables 91 91 to be eliminated later 92 92 RETURNS: list of two ideals the first containing the simplified … … 94 94 been eliminated 95 95 EXAMPLE: example simplify; shows an example 96 96 " 97 97 { 98 98 int @i,@j; … … 144 144 145 145 proc fastElim 146 USAGE: fastelim(id,v); id ideal, v Product of variables to146 "USAGE: fastelim(id,v); id ideal, v Product of variables to 147 147 be eliminated. 148 148 RETURNS: list of two ideals the first containing the simplified … … 150 150 been eliminated 151 151 EXAMPLE: example fastElim; shows an example. 152 {152 "{ 153 153 string @oldgnir = nameof(basering); // Namen des alten Baserings merken 154 154 string @varnames; … … 275 275 276 276 proc valvars 277 277 " 278 278 USAGE: valvars(id, [n1, [m, [n2]]]); id (poly|ideal|vector|module); 279 279 m monom; n1,n2 int … … 289 289 contains more monomials than that of y. 290 290 EXAMPLE: example valvars; shows an example 291 291 " 292 292 { 293 293 int @order1, @order2, // order of vars not to elim resp. to elim -
Singular/LIB/finvar.lib
r4996f52 rd2b2a7 1 // $Id: finvar.lib,v 1. 9 1998-05-03 11:57:37 obachmanExp $1 // $Id: finvar.lib,v 1.10 1998-05-05 11:55:25 krueger Exp $ 2 2 // author: Agnes Eileen Heydtmann, email:agnes@math.uni-sb.de 3 3 // last change: 3.5.98 4 4 ////////////////////////////////////////////////////////////////////////////// 5 version="$Id: finvar.lib,v 1. 9 1998-05-03 11:57:37 obachmanExp $"5 version="$Id: finvar.lib,v 1.10 1998-05-05 11:55:25 krueger Exp $" 6 6 info=" 7 7 LIBRARY: finvar.lib LIBRARY TO CALCULATE INVARIANT RINGS & MORE … … 65 65 66 66 proc cyclotomic (int i) 67 USAGE: cyclotomic(i);67 "USAGE: cyclotomic(i); 68 68 i: an <int> > 0 69 69 RETURNS: the i-th cyclotomic polynomial (type <poly>) as one in the first ring … … 72 72 THEORY: x^i-1 is divided by the j-th cyclotomic polynomial where j takes on the 73 73 value of proper divisors of i 74 " 74 75 { if (i<=0) 75 76 { "ERROR: the input should be > 0."; … … 114 115 115 116 proc group_reynolds (list #) 116 USAGE: group_reynolds(G1,G2,...[,v]);117 "USAGE: group_reynolds(G1,G2,...[,v]); 117 118 G1,G2,...: nxn <matrices> generating a finite matrix group, v: an 118 119 optional <int> … … 135 136 the Reynolds operator is made up is generated. They are stored in the 136 137 rows of the first return value. 138 " 137 139 { int ch=char(basering); // the existance of the Reynolds operator 138 140 // is dependent on the characteristic of … … 320 322 321 323 proc molien (list #) 322 USAGE: molien(G1,G2,...[,ringname,lcm,flags]);324 "USAGE: molien(G1,G2,...[,ringname,lcm,flags]); 323 325 G1,G2,...: nxn <matrices> generating a finite matrix group, ringname: 324 326 a <string> giving a name for a new ring of characteristic 0 for the … … 350 352 enumerator and denominator of the expanded version where common factors 351 353 have been canceled. 354 " 352 355 { def br=basering; // the Molien series depends on the 353 356 int ch=char(br); // characteristic of the coefficient … … 858 861 859 862 proc reynolds_molien (list #) 860 USAGE: reynolds_molien(G1,G2,...[,ringname,flags]);863 "USAGE: reynolds_molien(G1,G2,...[,ringname,flags]); 861 864 G1,G2,...: nxn <matrices> generating a finite matrix group, ringname: 862 865 a <string> giving a name for a new ring of characteristic 0 for the … … 894 897 modular case). The returned matrix gives enumerator and denominator of 895 898 the expanded version where common factors have been canceled. 899 " 896 900 { def br=basering; // the Molien series depends on the 897 901 int ch=char(br); // characteristic of the coefficient … … 1403 1407 1404 1408 proc partial_molien (matrix M, int n, list #) 1405 USAGE: partial_molien(M,n[,p]);1409 "USAGE: partial_molien(M,n[,p]); 1406 1410 M: a 1x2 <matrix>, n: an <int> indicating number of terms in the 1407 1411 expansion, p: an optional <poly> … … 1421 1425 (a1-b1)x+b1(a1-b1)x^2+... 1422 1426 EXAMPLE: example partial_molien; shows an example 1427 " 1423 1428 { poly A(2); // A(2) will contain the return value of 1424 1429 // the intermediate result … … 1489 1494 1490 1495 proc evaluate_reynolds (matrix REY, ideal I) 1491 USAGE: evaluate_reynolds(REY,I);1496 "USAGE: evaluate_reynolds(REY,I); 1492 1497 REY: a <matrix> representing the Reynolds operator, I: an arbitrary 1493 1498 <ideal> … … 1500 1505 THEORY: REY has been constructed in such a way that each row serves as a ring 1501 1506 mapping of which the Reynolds operator is made up. 1507 " 1502 1508 { def br=basering; 1503 1509 int n=nvars(br); … … 1537 1543 1538 1544 proc invariant_basis (int g,list #) 1539 USAGE: invariant_basis(g,G1,G2,...);1545 "USAGE: invariant_basis(g,G1,G2,...); 1540 1546 g: an <int> indicating of which degree (>0) the homogeneous basis 1541 1547 shoud be, G1,G2,...: <matrices> generating a finite matrix group … … 1546 1552 system of linear equations is created. It is solved by computing 1547 1553 syzygies. 1554 " 1548 1555 { if (g<=0) 1549 1556 { "ERROR: the first parameter should be > 0"; … … 1626 1633 1627 1634 proc invariant_basis_reynolds (matrix REY,int d,list #) 1628 USAGE: invariant_basis_reynolds(REY,d[,flags]);1635 "USAGE: invariant_basis_reynolds(REY,d[,flags]); 1629 1636 REY: a <matrix> representing the Reynolds operator, d: an <int> 1630 1637 indicating of which degree (>0) the homogeneous basis shoud be, flags: … … 1643 1650 operator. A linearly independent set is generated with the help of 1644 1651 minbase. 1652 " 1645 1653 { 1646 1654 //---------------------- checking that the input is ok ----------------------- … … 2025 2033 2026 2034 proc primary_char0 (matrix REY,matrix M,list #) 2027 USAGE: primary_char0(REY,M[,v]);2035 "USAGE: primary_char0(REY,M[,v]); 2028 2036 REY: a <matrix> representing the Reynolds operator, M: a 1x2 <matrix> 2029 2037 representing the Molien series, v: an optional <int> … … 2036 2044 THEORY: Bases of homogeneous invariants are generated successively and those 2037 2045 are chosen as primary invariants that lower the dimension of the ideal 2038 generated by the previously found invariants (see paper "Generating a2039 Noetherian Normalization of the Invariant Ring of a Finite Group " by2046 generated by the previously found invariants (see paper \"Generating a 2047 Noetherian Normalization of the Invariant Ring of a Finite Group\" by 2040 2048 Decker, Heydtmann, Schreyer (1997) to appear in JSC). 2049 " 2041 2050 { degBound=0; 2042 2051 if (char(basering)<>0) … … 2165 2174 2166 2175 proc primary_charp (matrix REY,string ring_name,list #) 2167 USAGE: primary_charp(REY,ringname[,v]);2176 "USAGE: primary_charp(REY,ringname[,v]); 2168 2177 REY: a <matrix> representing the Reynolds operator, ringname: a 2169 2178 <string> giving the name of a ring where the Molien series is stored, … … 2178 2187 THEORY: Bases of homogeneous invariants are generated successively and those 2179 2188 are chosen as primary invariants that lower the dimension of the ideal 2180 generated by the previously found invariants (see paper "Generating a2181 Noetherian Normalization of the Invariant Ring of a Finite Group " by2189 generated by the previously found invariants (see paper \"Generating a 2190 Noetherian Normalization of the Invariant Ring of a Finite Group\" by 2182 2191 Decker, Heydtmann, Schreyer (1997) to appear in JSC). 2192 " 2183 2193 { degBound=0; 2184 2194 // ---------------- checking input and setting verbose mode ------------------- … … 2317 2327 2318 2328 proc primary_char0_no_molien (matrix REY, list #) 2319 USAGE: primary_char0_no_molien(REY[,v]);2329 "USAGE: primary_char0_no_molien(REY[,v]); 2320 2330 REY: a <matrix> representing the Reynolds operator, v: an optional 2321 2331 <int> … … 2329 2339 THEORY: Bases of homogeneous invariants are generated successively and those 2330 2340 are chosen as primary invariants that lower the dimension of the ideal 2331 generated by the previously found invariants (see paper "Generating a2332 Noetherian Normalization of the Invariant Ring of a Finite Group " by2341 generated by the previously found invariants (see paper \"Generating a 2342 Noetherian Normalization of the Invariant Ring of a Finite Group\" by 2333 2343 Decker, Heydtmann, Schreyer (1997) to appear in JSC). 2344 " 2334 2345 { degBound=0; 2335 2346 //-------------- checking input and setting verbose mode --------------------- … … 2459 2470 2460 2471 proc primary_charp_no_molien (matrix REY, list #) 2461 USAGE: primary_charp_no_molien(REY[,v]);2472 "USAGE: primary_charp_no_molien(REY[,v]); 2462 2473 REY: a <matrix> representing the Reynolds operator, v: an optional 2463 2474 <int> … … 2471 2482 THEORY: Bases of homogeneous invariants are generated successively and those 2472 2483 are chosen as primary invariants that lower the dimension of the ideal 2473 generated by the previously found invariants (see paper "Generating a2474 Noetherian Normalization of the Invariant Ring of a Finite Group " by2484 generated by the previously found invariants (see paper \"Generating a 2485 Noetherian Normalization of the Invariant Ring of a Finite Group\" by 2475 2486 Decker, Heydtmann, Schreyer (1997) to appear in JSC). 2487 " 2476 2488 { degBound=0; 2477 2489 //----------------- checking input and setting verbose mode ------------------ … … 2603 2615 2604 2616 proc primary_charp_without (list #) 2605 USAGE: primary_charp_without(G1,G2,...[,v]);2617 "USAGE: primary_charp_without(G1,G2,...[,v]); 2606 2618 G1,G2,...: <matrices> generating a finite matrix group, v: an optional 2607 2619 <int> … … 2612 2624 THEORY: Bases of homogeneous invariants are generated successively and those 2613 2625 are chosen as primary invariants that lower the dimension of the ideal 2614 generated by the previously found invariants (see paper "Generating a2615 Noetherian Normalization of the Invariant Ring of a Finite Group " by2626 generated by the previously found invariants (see paper \"Generating a 2627 Noetherian Normalization of the Invariant Ring of a Finite Group\" by 2616 2628 Decker, Heydtmann, Schreyer (1997) to appear in JSC). No Reynolds 2617 2629 operator or Molien series is used. 2630 " 2618 2631 { degBound=0; 2619 2632 //--------------------- checking input and setting verbose mode -------------- … … 2741 2754 2742 2755 proc primary_invariants (list #) 2743 USAGE: primary_invariants(G1,G2,...[,flags]);2756 "USAGE: primary_invariants(G1,G2,...[,flags]); 2744 2757 G1,G2,...: <matrices> generating a finite matrix group, flags: an 2745 2758 optional <intvec> with three entries, if the first one equals 0 (also … … 2767 2780 THEORY: Bases of homogeneous invariants are generated successively and those 2768 2781 are chosen as primary invariants that lower the dimension of the ideal 2769 generated by the previously found invariants (see paper "Generating a2770 Noetherian Normalization of the Invariant Ring of a Finite Group " by2782 generated by the previously found invariants (see paper \"Generating a 2783 Noetherian Normalization of the Invariant Ring of a Finite Group\" by 2771 2784 Decker, Heydtmann, Schreyer (1997) to appear in JSC). 2785 " 2772 2786 { 2773 2787 // ----------------- checking input and setting flags ------------------------ … … 3149 3163 3150 3164 proc primary_char0_random (matrix REY,matrix M,int max,list #) 3151 USAGE: primary_char0_random(REY,M,r[,v]);3165 "USAGE: primary_char0_random(REY,M,r[,v]); 3152 3166 REY: a <matrix> representing the Reynolds operator, M: a 1x2 <matrix> 3153 3167 representing the Molien series, r: an <int> where -|r| to |r| is the … … 3163 3177 linear combinations are chosen as primary invariants that lower the 3164 3178 dimension of the ideal generated by the previously found invariants 3165 (see paper "Generating a Noetherian Normalization of the Invariant Ring3166 of a Finite Group " by Decker, Heydtmann, Schreyer (1997) to appear in3179 (see paper \"Generating a Noetherian Normalization of the Invariant Ring 3180 of a Finite Group\" by Decker, Heydtmann, Schreyer (1997) to appear in 3167 3181 JSC). 3182 " 3168 3183 { degBound=0; 3169 3184 if (char(basering)<>0) … … 3295 3310 3296 3311 proc primary_charp_random (matrix REY,string ring_name,int max,list #) 3297 USAGE: primary_charp_random(REY,ringname,r[,v]);3312 "USAGE: primary_charp_random(REY,ringname,r[,v]); 3298 3313 REY: a <matrix> representing the Reynolds operator, ringname: a 3299 3314 <string> giving the name of a ring where the Molien series is stored, … … 3310 3325 linear combinations are chosen as primary invariants that lower the 3311 3326 dimension of the ideal generated by the previously found invariants 3312 (see paper "Generating a Noetherian Normalization of the Invariant Ring3313 of a Finite Group " by Decker, Heydtmann, Schreyer (1997) to appear in3327 (see paper \"Generating a Noetherian Normalization of the Invariant Ring 3328 of a Finite Group\" by Decker, Heydtmann, Schreyer (1997) to appear in 3314 3329 JSC). 3330 " 3315 3331 { degBound=0; 3316 3332 // ---------------- checking input and setting verbose mode ------------------ … … 3452 3468 3453 3469 proc primary_char0_no_molien_random (matrix REY, int max, list #) 3454 USAGE: primary_char0_no_molien_random(REY,r[,v]);3470 "USAGE: primary_char0_no_molien_random(REY,r[,v]); 3455 3471 REY: a <matrix> representing the Reynolds operator, r: an <int> where 3456 3472 -|r| to |r| is the range of coefficients of the random combinations of … … 3466 3482 linear combinations are chosen as primary invariants that lower the 3467 3483 dimension of the ideal generated by the previously found invariants 3468 (see paper "Generating a Noetherian Normalization of the Invariant Ring3469 of a Finite Group " by Decker, Heydtmann, Schreyer (1997) to appear in3484 (see paper \"Generating a Noetherian Normalization of the Invariant Ring 3485 of a Finite Group\" by Decker, Heydtmann, Schreyer (1997) to appear in 3470 3486 JSC). 3487 " 3471 3488 { degBound=0; 3472 3489 //-------------- checking input and setting verbose mode --------------------- … … 3599 3616 3600 3617 proc primary_charp_no_molien_random (matrix REY, int max, list #) 3601 USAGE: primary_charp_no_molien_random(REY,r[,v]);3618 "USAGE: primary_charp_no_molien_random(REY,r[,v]); 3602 3619 REY: a <matrix> representing the Reynolds operator, r: an <int> where 3603 3620 -|r| to |r| is the range of coefficients of the random combinations of … … 3613 3630 linear combinations are chosen as primary invariants that lower the 3614 3631 dimension of the ideal generated by the previously found invariants 3615 (see paper "Generating a Noetherian Normalization of the Invariant Ring3616 of a Finite Group " by Decker, Heydtmann, Schreyer (1997) to appear in3632 (see paper \"Generating a Noetherian Normalization of the Invariant Ring 3633 of a Finite Group\" by Decker, Heydtmann, Schreyer (1997) to appear in 3617 3634 JSC). 3635 " 3618 3636 { degBound=0; 3619 3637 //----------------- checking input and setting verbose mode ------------------ … … 3747 3765 3748 3766 proc primary_charp_without_random (list #) 3749 USAGE: primary_charp_without_random(G1,G2,...,r[,v]);3767 "USAGE: primary_charp_without_random(G1,G2,...,r[,v]); 3750 3768 G1,G2,...: <matrices> generating a finite matrix group, r: an <int> 3751 3769 where -|r| to |r| is the range of coefficients of the random … … 3758 3776 linear combinations are chosen as primary invariants that lower the 3759 3777 dimension of the ideal generated by the previously found invariants 3760 (see paper "Generating a Noetherian Normalization of the Invariant Ring3761 of a Finite Group " by Decker, Heydtmann, Schreyer (1997) to appear in3778 (see paper \"Generating a Noetherian Normalization of the Invariant Ring 3779 of a Finite Group\" by Decker, Heydtmann, Schreyer (1997) to appear in 3762 3780 JSC). No Reynolds operator or Molien series is used. 3781 " 3763 3782 { degBound=0; 3764 3783 //--------------------- checking input and setting verbose mode -------------- … … 3896 3915 3897 3916 proc primary_invariants_random (list #) 3898 USAGE: primary_invariants_random(G1,G2,...,r[,flags]);3917 "USAGE: primary_invariants_random(G1,G2,...,r[,flags]); 3899 3918 G1,G2,...: <matrices> generating a finite matrix group, r: an <int> 3900 3919 where -|r| to |r| is the range of coefficients of the random … … 3925 3944 linear combinations are chosen as primary invariants that lower the 3926 3945 dimension of the ideal generated by the previously found invariants 3927 (see paper "Generating a Noetherian Normalization of the Invariant Ring3928 of a Finite Group " by Decker, Heydtmann, Schreyer (1997) to appear in3946 (see paper \"Generating a Noetherian Normalization of the Invariant Ring 3947 of a Finite Group\" by Decker, Heydtmann, Schreyer (1997) to appear in 3929 3948 JSC). 3949 " 3930 3950 { 3931 3951 // ----------------- checking input and setting flags ------------------------ … … 4110 4130 4111 4131 proc power_products(intvec deg_vec,int d) 4112 USAGE: power_products(dv,d);4132 "USAGE: power_products(dv,d); 4113 4133 dv: an <intvec> giving the degrees of homogeneous polynomials, d: the 4114 4134 degree of the desired power products … … 4117 4137 of the powers is then homogeneous of degree d. 4118 4138 EXAMPLE: example power_products; gives an example 4139 " 4119 4140 { ring R=0,x,dp; 4120 4141 if (d<=0) … … 4166 4187 4167 4188 proc secondary_char0 (matrix P, matrix REY, matrix M, list #) 4168 USAGE: secondary_char0(P,REY,M[,v]);4189 "USAGE: secondary_char0(P,REY,M[,v]); 4169 4190 P: a 1xn <matrix> with primary invariants, REY: a gxn <matrix> 4170 4191 representing the Reynolds operator, M: a 1x2 <matrix> giving enumerator … … 4183 4204 to invariants with the Reynolds operator and using these images or 4184 4205 their power products such that they are linearly independent modulo the 4185 primary invariants (see paper "Some Algorithms in Invariant Theory of 4186 Finite Groups" by Kemper and Steel (1997)). 4206 primary invariants (see paper \"Some Algorithms in Invariant Theory of 4207 Finite Groups\" by Kemper and Steel (1997)). 4208 " 4187 4209 { def br=basering; 4188 4210 degBound=0; … … 4373 4395 4374 4396 proc secondary_charp (matrix P, matrix REY, string ring_name, list #) 4375 USAGE: secondary_charp(P,REY,ringname[,v]);4397 "USAGE: secondary_charp(P,REY,ringname[,v]); 4376 4398 P: a 1xn <matrix> with primary invariants, REY: a gxn <matrix> 4377 4399 representing the Reynolds operator, ringname: a <string> giving the … … 4391 4413 to invariants with the Reynolds operator and using these images or 4392 4414 their power products such that they are linearly independent modulo the 4393 primary invariants (see paper "Some Algorithms in Invariant Theory of 4394 Finite Groups" by Kemper and Steel (1997)). 4415 primary invariants (see paper \"Some Algorithms in Invariant Theory of 4416 Finite Groups\" by Kemper and Steel (1997)). 4417 " 4395 4418 { def br=basering; 4396 4419 degBound=0; … … 4596 4619 4597 4620 proc secondary_no_molien (matrix P, matrix REY, list #) 4598 USAGE: secondary_no_molien(P,REY[,deg_vec,v]);4621 "USAGE: secondary_no_molien(P,REY[,deg_vec,v]); 4599 4622 P: a 1xn <matrix> with primary invariants, REY: a gxn <matrix> 4600 4623 representing the Reynolds operator, deg_vec: an optional <intvec> … … 4613 4636 to invariants with the Reynolds operator and using these images as 4614 4637 candidates for secondary invariants. 4638 " 4615 4639 { int i; 4616 4640 degBound=0; … … 4754 4778 4755 4779 proc secondary_with_irreducible_ones_no_molien (matrix P, matrix REY, list #) 4756 USAGE: secondary_with_irreducible_ones_no_molien(P,REY[,v]);4780 "USAGE: secondary_with_irreducible_ones_no_molien(P,REY[,v]); 4757 4781 P: a 1xn <matrix> with primary invariants, REY: a gxn <matrix> 4758 4782 representing the Reynolds operator, v: an optional <int> … … 4768 4792 to invariants with the Reynolds operator and using these images or 4769 4793 their power products such that they are linearly independent modulo the 4770 primary invariants (see paper "Some Algorithms in Invariant Theory of 4771 Finite Groups" by Kemper and Steel (1997)). 4794 primary invariants (see paper \"Some Algorithms in Invariant Theory of 4795 Finite Groups\" by Kemper and Steel (1997)). 4796 " 4772 4797 { int i; 4773 4798 degBound=0; … … 4950 4975 4951 4976 proc secondary_not_cohen_macaulay (matrix P, list #) 4952 USAGE: secondary_not_cohen_macaulay(P,G1,G2,...[,v]);4977 "USAGE: secondary_not_cohen_macaulay(P,G1,G2,...[,v]); 4953 4978 P: a 1xn <matrix> with primary invariants, G1,G2,...: nxn <matrices> 4954 4979 generating a finite matrix group, v: an optional <int> … … 4957 4982 DISPLAY: information if v does not equal 0 4958 4983 EXAMPLE: example secondary_not_cohen_macaulay; shows an example 4959 THEORY: The secondary invariants are generated following "Generating Invariant4960 Rings of Finite Groups over Arbitrary Fields " by Kemper (1996, to4984 THEORY: The secondary invariants are generated following \"Generating Invariant 4985 Rings of Finite Groups over Arbitrary Fields\" by Kemper (1996, to 4961 4986 appear in JSC). 4987 " 4962 4988 { int i, j; 4963 4989 degBound=0; … … 5117 5143 5118 5144 proc invariant_ring (list #) 5119 USAGE: invariant_ring(G1,G2,...[,flags]);5145 "USAGE: invariant_ring(G1,G2,...[,flags]); 5120 5146 G1,G2,...: <matrices> generating a finite matrix group, flags: an 5121 5147 optional <intvec> with three entries: if the first one equals 0, the … … 5143 5169 THEORY: Bases of homogeneous invariants are generated successively and those 5144 5170 are chosen as primary invariants that lower the dimension of the ideal 5145 generated by the previously found invariants (see paper "Generating a5146 Noetherian Normalization of the Invariant Ring of a Finite Group " by5171 generated by the previously found invariants (see paper \"Generating a 5172 Noetherian Normalization of the Invariant Ring of a Finite Group\" by 5147 5173 Decker, Heydtmann, Schreyer (1997) to appear in JSC). In the 5148 5174 non-modular case secondary invariants are calculated by finding a … … 5150 5176 invariants, mapping to invariants with the Reynolds operator and using 5151 5177 those or their power products such that they are linearly independent 5152 modulo the primary invariants (see paper "Some Algorithms in Invariant5153 Theory of Finite Groups " by Kemper and Steel (1997)). In the modular5154 case they are generated according to "Generating Invariant Rings of5155 Finite Groups over Arbitrary Fields " by Kemper (1996, to appear in5178 modulo the primary invariants (see paper \"Some Algorithms in Invariant 5179 Theory of Finite Groups\" by Kemper and Steel (1997)). In the modular 5180 case they are generated according to \"Generating Invariant Rings of 5181 Finite Groups over Arbitrary Fields\" by Kemper (1996, to appear in 5156 5182 JSC). 5183 " 5157 5184 { if (size(#)==0) 5158 5185 { "ERROR: There are no generators given."; … … 5322 5349 5323 5350 proc invariant_ring_random (list #) 5324 USAGE: invariant_ring_random(G1,G2,...,r[,flags]);5351 "USAGE: invariant_ring_random(G1,G2,...,r[,flags]); 5325 5352 G1,G2,...: <matrices> generating a finite matrix group, r: an <int> 5326 5353 where -|r| to |r| is the range of coefficients of random … … 5352 5379 hopefully they lower the dimension of the previously found primary 5353 5380 invariants by the right amount. 5381 " 5354 5382 { if (size(#)<2) 5355 5383 { "ERROR: There are too few parameters."; … … 5545 5573 5546 5574 proc algebra_containment (poly p, matrix A) 5547 USAGE: algebra_containment(p,A);5575 "USAGE: algebra_containment(p,A); 5548 5576 p: arbitrary <poly>, A: a 1xm <matrix> giving generators of a 5549 5577 subalgebra of the basering … … 5558 5586 to a polynomial only in the y(i) <=> p is contained in the subring 5559 5587 generated by the polynomials in A. 5588 " 5560 5589 { degBound=0; 5561 5590 if (nrows(A)==1) … … 5601 5630 5602 5631 proc module_containment(poly p, matrix P, matrix S) 5603 USAGE: module_containment(p,P,S);5632 "USAGE: module_containment(p,P,S); 5604 5633 p: arbitrary <poly>, P: a 1xn <matrix> giving generators of an algebra, 5605 5634 S: a 1xt <matrix> giving generators of a module over the algebra … … 5619 5648 again. p reduces to a polynomial only in the y(j) and z(i) linear in 5620 5649 the z(i)) <=> p is contained in the module. 5650 " 5621 5651 { def br=basering; 5622 5652 degBound=0; … … 5669 5699 5670 5700 proc orbit_variety (matrix F,string newring) 5671 USAGE: orbit_variety(F,s);5701 "USAGE: orbit_variety(F,s); 5672 5702 F: a 1xm <matrix> defing an invariant ring, s: a <string> giving the 5673 5703 name for a new ring … … 5678 5708 calculated, then the variables of the original ring are eliminated and 5679 5709 the polynomials that are left over define the orbit variety 5710 " 5680 5711 { if (newring=="") 5681 5712 { "ERROR: the second parameter may not be an empty <string>"; … … 5725 5756 5726 5757 proc relative_orbit_variety(ideal I,matrix F,string newring) 5727 USAGE: relative_orbit_variety(I,F,s);5758 "USAGE: relative_orbit_variety(I,F,s); 5728 5759 I: an <ideal> invariant under the action of a group, F: a 1xm 5729 5760 <matrix> defining the invariant ring of this group, s: a <string> … … 5737 5768 the polynomials that are left over define thecrelative orbit variety 5738 5769 with respect to I. 5770 " 5739 5771 { if (newring=="") 5740 5772 { "ERROR: the third parameter may not be empty a <string>"; … … 5805 5837 5806 5838 proc image_of_variety(ideal I,matrix F) 5807 USAGE: image_of_variety(I,F);5839 "USAGE: image_of_variety(I,F); 5808 5840 I: an arbitray <ideal>, F: a 1xm <matrix> defining an invariant ring 5809 5841 of a some matrix group … … 5815 5847 invariant ring. This ideal in the original variables defines the image 5816 5848 of the variety defined by I 5849 " 5817 5850 { if (nrows(F)==1) 5818 5851 { def br=basering; -
Singular/LIB/general.lib
r4996f52 rd2b2a7 1 // $Id: general.lib,v 1. 6 1998-04-23 17:09:20 Singular Exp $1 // $Id: general.lib,v 1.7 1998-05-05 11:55:27 krueger 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. 6 1998-04-23 17:09:20 Singular Exp $";6 version="$Id: general.lib,v 1.7 1998-05-05 11:55:27 krueger Exp $"; 7 7 info=" 8 8 LIBRARY: general.lib PROCEDURES OF GENERAL TYPE … … 30 30 31 31 proc A_Z (string s,int n) 32 USAGE: A_Z("a",n); a any letter, n integer (-26<= n <=26, !=0)32 "USAGE: A_Z(\"a\",n); a any letter, n integer (-26<= n <=26, !=0) 33 33 RETURN: string of n small (if a is small) or capital (if a is capital) 34 34 letters, comma seperated, beginning with a, in alphabetical 35 35 order (or revers alphabetical order if n<0) 36 36 EXAMPLE: example A_Z; shows an example 37 " 37 38 { 38 39 if ( n>=-26 and n<=26 and n!=0 ) … … 85 86 86 87 proc binomial (int n, int k, list #) 87 USAGE: binomial(n,k[,p/s]); n,k,p integers, s string88 "USAGE: binomial(n,k[,p/s]); n,k,p integers, s string 88 89 RETURN: binomial(n,k); binomial coefficient n choose k of type int 89 90 (machine integer, limited size! ) … … 92 93 in char of basering if a basering is defined 93 94 EXAMPLE: example binomial; shows an example 95 " 94 96 { 95 97 if ( size(#)==0 ) { int rr=1; } … … 120 122 121 123 proc factorial (int n, list #) 122 USAGE: factorial(n[,string]); n integer124 "USAGE: factorial(n[,string]); n integer 123 125 RETURN: factorial(n); string of n! in char 0 124 126 factorial(n,s); n! of type number (s any string), computed in char of 125 127 basering if a basering is defined 126 128 EXAMPLE: example factorial; shows an example 129 " 127 130 { 128 131 if ( size(#)==0 ) { ring R = 0,x,dp; poly r=1; } … … 148 151 149 152 proc fibonacci (int n, list #) 150 USAGE: fibonacci(n[,string]); (n integer)153 "USAGE: fibonacci(n[,string]); (n integer) 151 154 RETURN: fibonacci(n); string of nth Fibonacci number, 152 155 f(0)=f(1)=1, f(i+1)=f(i-1)+f(i) … … 154 157 computed in characteristic of basering if a basering is defined 155 158 EXAMPLE: example fibonacci; shows an example 159 " 156 160 { 157 161 if ( size(#)==0 ) { ring fibo = 0,x,dp; number f=1; } … … 177 181 178 182 proc kmemory () 179 USAGE: kmemory();183 "USAGE: kmemory(); 180 184 RETURN: memory used by active variables, of type int (in kilobyte) 181 185 EXAMPLE: example kmemory; shows an example 186 " 182 187 { 183 188 if ( voice==2 ) { "// memory used by active variables (kilobyte):"; } … … 191 196 192 197 proc killall 193 USAGE: killall(); (no parameter)194 killall( "type_name");195 killall( "not", "type_name");198 "USAGE: killall(); (no parameter) 199 killall(\"type_name\"); 200 killall(\"not\", \"type_name\"); 196 201 COMPUTE: killall(); kills all user-defined variables but not loaded procedures 197 killall( "type_name"); kills all user-defined variables, of type "type_name"198 killall( "not", "type_name"); kills all user-defined199 variables, except those of type "type_name" and except loaded procedures202 killall(\"type_name\"); kills all user-defined variables, of type \"type_name\" 203 killall(\"not\", \"type_name\"); kills all user-defined 204 variables, except those of type \"type_name\" and except loaded procedures 200 205 RETURN: no return value 201 206 NOTE: killall should never be used inside a procedure 202 207 EXAMPLE: example killall; shows an example AND KILLS ALL YOUR VARIABLES 208 " 203 209 { 204 210 list L=names(); int joni=size(L); … … 255 261 256 262 proc number_e (int n) 257 USAGE: number_e(n); n integer263 "USAGE: number_e(n); n integer 258 264 COMPUTE: exp(1) up to n decimal digits (no rounding) 259 265 by A.H.J. Sale's algorithm … … 262 268 display its decimal format 263 269 EXAMPLE: example number_e; shows an example 270 " 264 271 { 265 272 int i,m,s,t; … … 296 303 297 304 proc number_pi (int n) 298 USAGE: number_pi(n); n positive integer305 "USAGE: number_pi(n); n positive integer 299 306 COMPUTE: pi (area of unit circle) up to n decimal digits (no rounding) 300 307 by algorithm of S. Rabinowitz … … 303 310 its decimal format 304 311 EXAMPLE: example number_pi; shows an example 312 " 305 313 { 306 314 int i,m,t,e,q,N; … … 366 374 367 375 proc primes (int n, int m) 368 USAGE: primes(n,m); n,m integers376 "USAGE: primes(n,m); n,m integers 369 377 RETURN: intvec, consisting of all primes p, prime(n)<=p<=m, in increasing 370 378 order if n<=m, resp. prime(m)<=p<=n, in decreasing order if m<n 371 379 NOTE: prime(n); returns the biggest prime number <= n (if n>=2, else 2) 372 380 EXAMPLE: example primes; shows an example 381 " 373 382 { int change; 374 383 if ( n>m ) { change=n; n=m ; m=change; change=1; } … … 386 395 387 396 proc product (id, list #) 388 USAGE: product(id[,v]); id=ideal/vector/module/matrix397 "USAGE: product(id[,v]); id=ideal/vector/module/matrix 389 398 resp.id=intvec/intmat, v=intvec (e.g. v=1..n, n=integer) 390 399 RETURN: poly resp. int which is the product of all entries of id, with index … … 393 402 identified with corresponding matrix M (columns of M generate m) 394 403 EXAMPLE: example product; shows an example 404 " 395 405 { 396 406 int n,j; … … 431 441 432 442 proc ringweights (r) 433 USAGE: ringweights(r); r ring443 "USAGE: ringweights(r); r ring 434 444 RETURN: intvec of weights of ring variables. If, say, x(1),...,x(n) are the 435 445 variables of the ring r, in this order, the resulting intvec is … … 439 449 the resulting intvec is 1,...,1 440 450 EXAMPLE: example ringweights; shows an example 451 " 441 452 { 442 453 int i; intvec v; setring r; … … 456 467 457 468 proc sort (id, list #) 458 USAGE: sort(id[v,o,n]); id=ideal/module/intvec/list (of intvec's or int's)469 "USAGE: sort(id[v,o,n]); id=ideal/module/intvec/list (of intvec's or int's) 459 470 sort may be called with 1, 2 or 3 arguments in the following way: 460 471 - sort(id[v,n]); v=intvec, n=integer, … … 488 499 Zero generators of ideal/module are deleted 489 500 EXAMPLE: example sort; shows an example 501 " 490 502 { 491 503 int ii,jj,s,n = 0,0,1,0; … … 580 592 581 593 proc sum (id, list #) 582 USAGE: sum(id[,v]); id=ideal/vector/module/matrix resp. id=intvec/intmat,594 "USAGE: sum(id[,v]); id=ideal/vector/module/matrix resp. id=intvec/intmat, 583 595 v=intvec (e.g. v=1..n, n=integer) 584 596 RETURN: poly resp. int which is the sum of all entries of id, with index … … 587 599 identified with corresponding matrix M (columns of M generate m) 588 600 EXAMPLE: example sum; shows an example 601 " 589 602 { 590 603 if( typeof(id)=="poly" or typeof(id)=="ideal" or typeof(id)=="vector" … … 625 638 626 639 proc which (command) 627 USAGE: which(command); command = string expression640 "USAGE: which(command); command = string expression 628 641 RETURN: Absolute pathname of command, if found in search path. 629 642 Empty string, otherwise. 630 643 NOTE: Based on the Unix command 'which'. 631 644 EXAMPLE: example which; shows an example 645 " 632 646 { 633 647 int rs; -
Singular/LIB/hnoether.lib
r4996f52 rd2b2a7 1 // $Id: hnoether.lib,v 1. 5 1998-04-23 13:23:23 obachmanExp $1 // $Id: hnoether.lib,v 1.6 1998-05-05 11:55:27 krueger 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. 5 1998-04-23 13:23:23 obachmanExp $";6 version="$Id: hnoether.lib,v 1.6 1998-05-05 11:55:27 krueger Exp $"; 7 7 info=" 8 8 LIBRARY: hnoether.lib PROCEDURES FOR THE HAMBURGER-NOETHER-DEVELOPMENT … … 54 54 55 55 proc getnm (poly f) 56 USAGE: getnm(f); f polynomial in x,y56 "USAGE: getnm(f); f polynomial in x,y 57 57 ASSUME: basering = ...,(x,y),ls; or ds 58 58 RETURN: intvec(n,m) : (0,n) is the intersection point of the Newton … … 61 61 m=-1 if this point doesn't exist 62 62 EXAMPLE: example getnm; shows an example 63 " 63 64 { 64 65 // wir gehen davon aus, dass die Prozedur von develop aufgerufen wurde, also … … 75 76 76 77 proc leit (poly f, int n, int m) 77 // leit(poly f, int n, int m) returns all monomials on the line78 "// leit(poly f, int n, int m) returns all monomials on the line 78 79 // from (0,n) to (m,0) in the Newton diagram 80 " 79 81 { 80 82 return(jet(f,m*n,intvec(n,m))-jet(f,m*n-1,intvec(n,m))) … … 82 84 /////////////////////////////////////////////////////////////////////////////// 83 85 proc testreducible (poly f, int n, int m) 84 // testreducible(poly f,int n,int m) returns true if there are points in the86 "// testreducible(poly f,int n,int m) returns true if there are points in the 85 87 // Newton diagram below the line (0,n)-(m,0) 88 " 86 89 { 87 90 return(size(jet(f,m*n-1,intvec(n,m))) != 0) … … 89 92 /////////////////////////////////////////////////////////////////////////////// 90 93 proc T_Transform (poly f, int Q, int N) 91 // returns f(y,xy^Q)/y^NQ 94 "// returns f(y,xy^Q)/y^NQ 95 " 92 96 { 93 97 map T = basering,y,x*y^Q; … … 96 100 /////////////////////////////////////////////////////////////////////////////// 97 101 proc T1_Transform (poly f, number d, int M) 98 // returns f(x,y+d*x^M) 102 "// returns f(x,y+d*x^M) 103 " 99 104 { 100 105 map T1 = basering,x,y+d*x^M; … … 104 109 105 110 proc T2_Transform (poly f, number d, int M, int N) 106 USAGE: T2_Transform(f,d,M,N); f poly, d number; M,N int111 "USAGE: T2_Transform(f,d,M,N); f poly, d number; M,N int 107 112 RETURN: list: poly T2(f,d',M,N), number d' in \{ d, 1/d \} 113 " 108 114 { 109 115 //---------------------- compute gcd and extgcd of N,M ----------------------- … … 145 151 146 152 proc koeff (poly f, int I, int J) 147 USAGE: koeff(f,I,J); f polynomial in x and y, I,J integers153 "USAGE: koeff(f,I,J); f polynomial in x and y, I,J integers 148 154 RETURN: if f = sum(a(i,j)*x^i*y^j), then koeff(f,I,J)= a(I,J) (of type number) 149 155 EXAMPLE: example koeff; shows an example 150 {156 "{ 151 157 matrix mat = coeffs(coeffs(f,y)[J+1,1],x); 152 158 if (size(mat) <= I) { return(0);} … … 161 167 162 168 proc squarefree (poly f) 163 USAGE: squarefree(f); f poly in x and y169 "USAGE: squarefree(f); f poly in x and y 164 170 RETURN: a squarefree divisor of f 165 171 Normally the return value is a greatest squarefree divisor, but there … … 167 173 are lost. 168 174 EXAMPLE: example squarefree; shows some examples. 169 {175 "{ 170 176 // es gibt noch ein Problem: syz gibt manchmal in Koerpererweiterung (p,a) 171 177 // nicht f/g zurueck, obwohl die Division aufgeht ... In dem Fall ist die … … 261 267 262 268 proc allsquarefree (poly f, poly l) 263 USAGE : allsquarefree(f,l); poly f,l269 "USAGE : allsquarefree(f,l); poly f,l 264 270 l is the squarefree divisor of f you get by l=squarefree(f); 265 271 RETURN: the squarefree divisor of f consisting of all irreducible factors of f … … 270 276 at the moment: it can return nonsense, if the basering has parameters) 271 277 EXAMPLE: example allsquarefree; shows an example 272 {278 "{ 273 279 //---------- eliminiere bereits mit squarefree gefundene Faktoren ------------ 274 280 poly g=l; // g = gcd(f,l); … … 303 309 304 310 proc polytest(poly f) 305 USAGE : polytest(f); f poly in x and y311 "USAGE : polytest(f); f poly in x and y 306 312 RETURN: a monomial of f with |coefficient| > 16001 307 313 or exponent divisible by 32003, if there is one … … 310 316 NOTE: this procedure is only useful in characteristic zero, because otherwise 311 317 there is no appropriate ordering of the leading coefficients 312 {318 "{ 313 319 poly verbrecher=0; 314 320 intvec leitexp; … … 327 333 328 334 proc develop 329 USAGE: develop(f [,n]); f polynomial in two variables, n integer335 "USAGE: develop(f [,n]); f polynomial in two variables, n integer 330 336 ASSUME: f irreducible as a power series (for reducible f use reddevelop) 331 337 RETURN: Hamburger-Noether development of f, in form of a list: … … 360 366 361 367 For time critical computations it is recommended to use 362 "ring ...,(x,y),ls" as basering - it increases the algorithm's speed.368 \"ring ...,(x,y),ls\" as basering - it increases the algorithm's speed. 363 369 364 370 EXAMPLES: example develop; shows an example 365 371 example param; shows an example for using the 2nd parameter 366 {372 "{ 367 373 //--------- Abfangen unzulaessiger Ringe: 1) nur eine Unbestimmte ------------ 368 374 poly f=#[1]; … … 729 735 730 736 proc param 731 USAGE: param(l) takes the output of develop(f)737 "USAGE: param(l) takes the output of develop(f) 732 738 (list l (matrix m, intvec v, int s[,poly g])) 733 739 and gives a parametrisation for f; the first variable of the active … … 741 747 example develop; shows another example 742 748 743 {749 "{ 744 750 //-------------------------- Initialisierungen ------------------------------- 745 751 matrix m=#[1]; … … 838 844 839 845 proc invariants 840 USAGE: invariants(l) takes the output of develop(f)846 "USAGE: invariants(l) takes the output of develop(f) 841 847 (list l (matrix m, intvec v, int s[,poly g])) 842 848 and computes some invariants: … … 848 854 an empty list, if an error occurred in the procedure develop 849 855 EXAMPLE: example invariants; shows an example 850 {856 "{ 851 857 //-------------------------- Initialisierungen ------------------------------- 852 858 matrix m=#[1]; … … 930 936 931 937 proc displayInvariants 932 USAGE: displayInvariants(l); takes the output both of938 "USAGE: displayInvariants(l); takes the output both of 933 939 develop(f) and reddevelop(f) 934 940 ( list l (matrix m, intvec v, int s[,poly g]) … … 938 944 RETURN: nothing 939 945 EXAMPLE: example displayInvariants; shows an example 940 {946 "{ 941 947 int i,j,k,mul; 942 948 string Ausgabe; … … 1015 1021 1016 1022 proc multiplicities 1017 USAGE: multiplicities(l) takes the output of develop(f)1023 "USAGE: multiplicities(l) takes the output of develop(f) 1018 1024 (list l (matrix m, intvec v, int s[,poly g])) 1019 1025 RETURN: intvec of the different multiplicities that occur during the succes- 1020 1026 sive blowing up of the curve corresponding to f 1021 1027 EXAMPLE: example multiplicities; shows an example 1022 {1028 "{ 1023 1029 matrix m=#[1]; 1024 1030 intvec v=#[2]; … … 1054 1060 1055 1061 proc puiseux2generators (intvec m, intvec n) 1056 USAGE: puiseux2generators (m,n);1062 "USAGE: puiseux2generators (m,n); 1057 1063 m,n intvecs with 1st resp. 2nd components of puiseux pairs 1058 1064 RETURN: intvec of the generators of the semigroup of values 1059 1065 EXAMPLE: example puiseux2generators; shows an example 1060 {1066 "{ 1061 1067 intvec beta; 1062 1068 int q=1; … … 1081 1087 1082 1088 proc generators 1083 USAGE: generators(l); takes the output of develop(f)1089 "USAGE: generators(l); takes the output of develop(f) 1084 1090 (list l (matrix m, intvec v, int s[,poly g])) 1085 1091 RETURN: intvec of the generators of the semigroup of values 1086 1092 EXAMPLE: example generators; shows an example 1093 " 1087 1094 { 1088 1095 list inv=invariants(#); … … 1100 1107 1101 1108 proc intersection (list hn1, list hn2) 1102 USAGE: intersection(hne1,hne2);1109 "USAGE: intersection(hne1,hne2); 1103 1110 hne1,hne2 two lists representing a HNE (normally two entries out of 1104 1111 the output of reddevelop), i.e. list(matrix,intvec,int[,poly]) … … 1106 1113 (of type int) 1107 1114 EXAMPLE: example intersection; shows an example 1115 " 1108 1116 { 1109 1117 //------------------ `intersect' ist schon reserviert ... -------------------- … … 1216 1224 1217 1225 proc displayHNE(list ldev,list #) 1218 USAGE: displayHNE(ldev,[,n]); ldev=list1226 "USAGE: displayHNE(ldev,[,n]); ldev=list 1219 1227 (output list of develop(f) or reddevelop(f)), n=int 1220 1228 RETURN: - if only one argument is given, no return value, but … … 1239 1247 The optional parameter is then ignored. 1240 1248 EXAMPLE: example displayHNE; shows an example 1249 " 1241 1250 { 1242 1251 if ((typeof(ldev[1])=="list") || (typeof(ldev[1])=="none")) { … … 1313 1322 1314 1323 proc newtonhoehne (poly f) 1315 USAGE: newtonhoehne(f); f poly1324 "USAGE: newtonhoehne(f); f poly 1316 1325 ASSUME: basering = ...,(x,y),ds or ls 1317 1326 RETURN: list of intvec(x,y) of coordinates of the newtonpolygon of f 1318 1327 NOTE: This proc is only available in versions of Singular that know the 1319 command system("newton",f); f poly 1328 command system(\"newton\",f); f poly 1329 " 1320 1330 { 1321 1331 intvec nm = getnm(f); … … 1329 1339 1330 1340 proc newtonpoly (poly f) 1331 USAGE: newtonpoly(f); f poly1341 "USAGE: newtonpoly(f); f poly 1332 1342 RETURN: list of intvec(x,y) of coordinates of the newtonpolygon of f 1333 1343 NOTE: There are many assumptions: (to improve speed) … … 1335 1345 - f(x,0) != 0 != f(0,y), f(0,0) = 0 1336 1346 EXAMPLE: example newtonpoly; shows an example 1347 " 1337 1348 { 1338 1349 intvec A=(0,ord(subst(f,x,0))); … … 1391 1402 1392 1403 proc charPoly(poly f, int M, int N) 1393 USAGE: charPoly(f,M,N); f poly in x,y, M,N int: length and height1404 "USAGE: charPoly(f,M,N); f poly in x,y, M,N int: length and height 1394 1405 of newtonpolygon of f, which has to be only one line 1395 1406 RETURN: the characteristic polynomial of f 1396 1407 EXAMPLE: example charPoly; shows an example 1408 " 1397 1409 { 1398 1410 poly charp; … … 1412 1424 1413 1425 proc find_in_list(list L,int p) 1414 USAGE: find_in_list(L,p); L: list of intvec(x,y)1426 "USAGE: find_in_list(L,p); L: list of intvec(x,y) 1415 1427 (sorted in y: L[1][2]>=L[2][2]), int p >= 0 1416 1428 RETURN: int i: L[i][2]=p if existent; otherwise i with L[i][2]<p if existent; 1417 1429 otherwise i = size(L)+1; 1430 " 1418 1431 { 1419 1432 int i; … … 1424 1437 /////////////////////////////////////////////////////////////////////////////// 1425 1438 proc set_list 1426 USAGE: set_list(L,v,l); L list, v intvec, l element of L (arbitrary type)1439 "USAGE: set_list(L,v,l); L list, v intvec, l element of L (arbitrary type) 1427 1440 RETURN: L with L[v[1]][v[2]][...][v[n]] set to l 1428 1441 WARNING: Make sure there is no conflict of types! … … 1432 1445 L[a][b][c]=q; 1433 1446 (but the last command will only produce an error message) 1447 " 1434 1448 { 1435 1449 list L=#[1]; … … 1451 1465 /////////////////////////////////////////////////////////////////////////////// 1452 1466 proc get_last_divisor(int M, int N) 1453 USAGE: get_last_divisor(M,N); int M,N1467 "USAGE: get_last_divisor(M,N); int M,N 1454 1468 RETURN: int Q: M=q1*N+r1, N=q2*r1+r2, ..., ri=Q*r(i+1) (Euclidean alg.) 1455 1469 EXAMPLE: example get_last_divisor; shows an example 1470 " 1456 1471 { 1457 1472 int R=M%N; int Q=M / N; … … 1466 1481 /////////////////////////////////////////////////////////////////////////////// 1467 1482 proc redleit (poly f,intvec S, intvec E) 1468 USAGE: redleit(f,S,E); f poly,1483 "USAGE: redleit(f,S,E); f poly, 1469 1484 S,E intvec(x,y): two different points on a line in the newtonpolygon 1470 1485 of f (e.g. the starting and the ending point) … … 1472 1487 NOTE: It is not checked whether S and E really belong to the newtonpolygon! 1473 1488 EXAMPLE: example redleit; shows an example 1489 " 1474 1490 { 1475 1491 if (E[1]<S[1]) { intvec H=E; E=S; S=H; } // S,E verkehrt herum eingegeben … … 1485 1501 1486 1502 proc extdevelop (list l, int Exaktheit) 1487 USAGE: extdevelop(l,n); list l (matrix m, intvec v, int s, poly g), int n1503 "USAGE: extdevelop(l,n); list l (matrix m, intvec v, int s, poly g), int n 1488 1504 takes the output l of develop(f) ( or extdevelop(L,n), 1489 1505 or one entry of the output of reddevelop(f)) and … … 1496 1512 Type help develop; for more details 1497 1513 EXAMPLE: example extdevelop; shows an example 1514 " 1498 1515 { 1499 1516 //------------ Initialisierungen und Abfangen unzulaessiger Aufrufe ---------- … … 1643 1660 1644 1661 proc stripHNE (list l) 1645 USAGE: stripHNE(l); takes the output both of develop(f) and reddevelop(f)1662 "USAGE: stripHNE(l); takes the output both of develop(f) and reddevelop(f) 1646 1663 ( list l (matrix m, intvec v, int s[,poly g]) 1647 1664 or list of lists in the form l ) … … 1653 1670 to use extdevelop with them. 1654 1671 EXAMPLE: example stripHNE; shows an example 1672 " 1655 1673 { 1656 1674 list h; … … 1675 1693 1676 1694 proc extractHNEs(list HNEs, int transvers) 1677 USAGE: extractHNEs(HNEs,transvers); list HNEs (output from HN),1695 "USAGE: extractHNEs(HNEs,transvers); list HNEs (output from HN), 1678 1696 int transvers: 1 if x,y were exchanged, 0 else 1679 1697 RETURN: list of Hamburger-Noether-Extensions in the form of reddevelop 1680 1698 NOTE: This procedure is only for internal purpose; examples don't make sense 1699 " 1681 1700 { 1682 1701 int i,maxspalte,hspalte,hnezaehler; … … 1710 1729 1711 1730 proc factorfirst(poly f, int M, int N) 1712 USAGE : factorfirst(f,M,N); f poly, M,N int1731 "USAGE : factorfirst(f,M,N); f poly, M,N int 1713 1732 RETURN: number d: f=c*(y^(N/e) - d*x^(M/e))^e with e=gcd(M,N), number c fitting 1714 1733 0 if d does not exist 1715 1734 EXAMPLE: example factorfirst; shows an example 1735 " 1716 1736 { 1717 1737 number c = koeff(f,0,N); … … 1759 1779 1760 1780 proc reddevelop (poly f) 1761 USAGE: reddevelop(f); f poly1781 "USAGE: reddevelop(f); f poly 1762 1782 RETURN: Hamburger-Noether development of f : 1763 1783 A list of lists in the form of develop(f); each entry contains the … … 1768 1788 the basering to ring HNEring=...,(x,y),ls; ! 1769 1789 EXAMPLE: example reddevelop; shows an example 1790 " 1770 1791 { 1771 1792 def altring = basering; … … 2092 2113 } 2093 2114 /////////////////////////////////////////////////////////////////////////////// 2094 2115 static 2095 2116 proc HN (poly f,int grenze, int Aufruf_Ebene) 2096 NOTE: This procedure is only for internal use, it is called via reddevelop 2117 "NOTE: This procedure is only for internal use, it is called via reddevelop 2118 " 2097 2119 { 2098 2120 //---------- Variablendefinitionen fuer den unverzweigten Teil: -------------- … … 2543 2565 /////////////////////////////////////////////////////////////////////////////// 2544 2566 2567 static 2545 2568 proc constructHNEs (list HNEs,int hnezaehler,list aneu,list azeilen,int zeile,ideal deltais,int Q,int j) 2546 NOTE: This procedure is only for internal use, it is called via HN 2569 "NOTE: This procedure is only for internal use, it is called via HN 2570 " 2547 2571 { 2548 2572 int zaehler,zl; … … 2574 2598 2575 2599 proc extrafactor (poly leitf, int M, int N) 2576 USAGE: factors,flag=extrafactor(f,M,N);2600 "USAGE: factors,flag=extrafactor(f,M,N); 2577 2601 list factors, int flag,M,N, poly f in x,y 2578 2602 ASSUME: basering is (0,a),(x,y),ds or ls … … 2587 2611 It becomes obsolete as soon as factorize works also in such rings. 2588 2612 EXAMPLE: example extrafactor; shows an example 2613 " 2589 2614 { 2590 2615 list faktoren; -
Singular/LIB/homolog.lib
r4996f52 rd2b2a7 1 // $Id: homolog.lib,v 1. 5 1998-04-03 22:47:06krueger Exp $1 // $Id: homolog.lib,v 1.6 1998-05-05 11:55:28 krueger Exp $ 2 2 //(BM/GMG, last modified 22.06.96) 3 3 /////////////////////////////////////////////////////////////////////////////// 4 4 5 version="$Id: homolog.lib,v 1. 5 1998-04-03 22:47:06krueger Exp $";5 version="$Id: homolog.lib,v 1.6 1998-05-05 11:55:28 krueger Exp $"; 6 6 info=" 7 7 LIBRARY: homolog.lib PROCEDURES FOR HOMOLOGICAL ALGEBRA … … 25 25 26 26 proc cup (module M,list #) 27 USAGE: cup(M,[,any,any]); M=module27 "USAGE: cup(M,[,any,any]); M=module 28 28 COMPUTE: cup-product Ext^1(M',M') x Ext^1(M',M') ---> Ext^2(M',M'), 29 29 where M':=R^m/M, if M in R^m, R basering (i.e. M':=coker(matrix(M))) … … 43 43 For computing cupproduct of M itself, apply proc to syz(M)! 44 44 EXAMPLE: example cup; shows examples 45 " 45 46 { 46 47 //---------- initialization --------------------------------------------------- … … 207 208 208 209 proc cupproduct (module M,N,P,int p,q,list #) 209 USAGE: cupproduct(M,N,P,p,q[,any]); M,N,P modules, p,q integers210 "USAGE: cupproduct(M,N,P,p,q[,any]); M,N,P modules, p,q integers 210 211 COMPUTE: cup-product Ext^p(M',N') x Ext^q(N',P') ---> Ext^p+q(M',P') 211 212 where M':=R^m/M, if M in R^m, R basering (i.e. M':=coker(matrix(M))) … … 225 226 For computing cupproduct of M,N itself, apply proc to syz(M),syz(N)! 226 227 EXAMPLE: example cupproduct; shows examples 228 " 227 229 { 228 230 //---------- initialization --------------------------------------------------- … … 413 415 414 416 proc Ext_R (intvec v, module M, list #) 415 USAGE: Ext_R(v,M[,p]); v=int/intvec , M=module, p=int417 "USAGE: Ext_R(v,M[,p]); v=int/intvec , M=module, p=int 416 418 COMPUTE: A presentation of Ext^k(M',R); for k=v[1],v[2],..., M'=coker(M). 417 419 Let ...--> F2 --> F1 --M-> F0-->M'-->0 be a free resolution of M'. If … … 434 436 or the 2 commands: list L=mres(M,2); Ext_R(k,L[2]); 435 437 EXAMPLE: example Ext_R; shows examples 438 " 436 439 { 437 440 … … 542 545 543 546 proc Ext (intvec v, module M, module N, list #) 544 USAGE: Ext(v,M,N[,any]); v=int/intvec, M,N=modules547 "USAGE: Ext(v,M,N[,any]); v=int/intvec, M,N=modules 545 548 COMPUTE: A presentation of Ext^k(M',N'); for k=v[1],v[2],... where 546 549 M'=coker(M) and N'=coker(N). Let … … 574 577 or: list P=mres(M,2); list Q=mres(N,2); Ext(k,P[2],Q[2]); 575 578 EXAMPLE: example Ext; shows examples 579 " 576 580 { 577 581 //---------- initialisation --------------------------------------------------- … … 703 707 704 708 proc Hom (module M, module N, list #) 705 USAGE: Hom(M,N,[any]); M,N=modules709 "USAGE: Hom(M,N,[any]); M,N=modules 706 710 COMPUTE: A presentation of Hom(M',N'), M'=coker(M), N'=coker(N) as follows: 707 711 Let ...-->F1 --M-> F0-->M'-->0 and ...-->G1 --N-> G0-->N'-->0 be … … 732 736 from another proc has the same effect as decreasing printlevel by 1. 733 737 EXAMPLE: example Hom; shows examples 738 " 734 739 { 735 740 //---------- initialisation --------------------------------------------------- … … 796 801 797 802 proc homology (matrix A,matrix B,module M,module N,list #) 798 USAGE: homology(A,B,M,N);803 "USAGE: homology(A,B,M,N); 799 804 COMPUTE: Let M and N be submodules of R^m and R^n presenting M'=R^m/M, N'=R^n/N 800 805 (R=basering) and let A,B matrices inducing maps R^k--A-->R^m--B-->R^n. … … 806 811 NOTE: homology returns a free module of rank m if ker(B)=im(A) 807 812 EXAMPLE: example homology; shows examples 813 " 808 814 { 809 815 module ker,ima; … … 831 837 832 838 proc kernel (matrix A,module M,module N) 833 USAGE: kernel(A,M,N);839 "USAGE: kernel(A,M,N); 834 840 COMPUTE: Let M and N be submodules of R^m and R^n presenting M'=R^m/M, N'=R^n/N 835 841 (R=basering) and let A:R^m-->R^n a matrix inducing a map A':M'-->N'. … … 845 851 RETURN: module K, a presentation of ker(A') 846 852 EXAMPLE: example kernel; shows examples 853 " 847 854 { 848 855 module M1 = modulo(A,N); … … 862 869 863 870 proc kohom (matrix M, int j) 864 USAGE: kohom(A,k); A=matrix, k=integer871 "USAGE: kohom(A,k); A=matrix, k=integer 865 872 RETURN: matrix Hom(R^k,A) i.e. let A be a matrix defining a map: F1 --> F2 of 866 873 free R-modules, the matrix of Hom(R^k,F1)-->Hom(R^k,F2) is computed 867 874 EXAMPLE: example kohom; shows an example 875 " 868 876 { 869 877 if (j==1) … … 882 890 883 891 proc kontrahom (matrix M, int j) 884 USAGE: kontrahom(A,k); A=matrix, k=integer892 "USAGE: kontrahom(A,k); A=matrix, k=integer 885 893 RETURN: matrix Hom(A,R^k), i.e. let A be a matrix defining a map: F1 --> F2 of 886 894 free R-modules, the matrix of Hom(F2,R^k)-->Hom(F1,R^k) is computed 887 895 EXAMPLE: example kontrahom; shows an example 896 " 888 897 { 889 898 if (j==1) -
Singular/LIB/inout.lib
r4996f52 rd2b2a7 1 // $Id: inout.lib,v 1. 4 1998-04-03 22:47:06krueger Exp $1 // $Id: inout.lib,v 1.5 1998-05-05 11:55:29 krueger 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. 4 1998-04-03 22:47:06krueger Exp $";6 version="$Id: inout.lib,v 1.5 1998-05-05 11:55:29 krueger Exp $"; 7 7 info=" 8 8 LIBRARY: inout.lib PROCEDURES FOR MANIPULATING IN- AND OUTPUT … … 24 24 25 25 proc allprint (list #) 26 USAGE: allprint(L); L list26 "USAGE: allprint(L); L list 27 27 CREATE: display L[1], L[2], ... if an integer with name ALLprint is defined, 28 makes "pause", if ALLprint > 028 makes \"pause\", if ALLprint > 0 29 29 listvar(matrix), if ALLprint = 2 30 30 RETURN: no return value 31 31 EXAMPLE: example allprint; shows an example 32 " 32 33 { 33 34 if( defined(ALLprint) ) … … 51 52 52 53 proc dbpri (int n ,list #) 53 USAGE: dbpri(n,L); n integer, L list54 "USAGE: dbpri(n,L); n integer, L list 54 55 CREATE: display L[1], L[2], ... if an integer with name printlevel is defined 55 56 and if n<=printlevel, set printlevel to 0 if it is not defined … … 59 60 It is similair but not the same as the internal function dbprint 60 61 EXAMPLE: example dbpri; shows an example 62 " 61 63 { 62 64 int i; … … 77 79 78 80 proc lprint 79 USAGE: lprint(id[,n]); id poly/ideal/vector/module/matrix, n integer81 "USAGE: lprint(id[,n]); id poly/ideal/vector/module/matrix, n integer 80 82 RETURN: string of id in a format fitting into lines of size n; if only one 81 83 argument is present, n = pagewidth … … 84 86 can be used as input to reproduce id 85 87 EXAMPLE: example lprint; shows an example 88 " 86 89 { 87 90 if (size(#)==1) { int n = pagewidth-3; } … … 142 145 143 146 proc pmat (matrix m, list #) 144 USAGE: pmat(M,[n]); M matrix, n integer147 "USAGE: pmat(M,[n]); M matrix, n integer 145 148 CREATE: display M in array format if it fits into pagewidth, no return value; 146 149 if n is given, only the first n characters of each colum are shown 147 150 RETURN: no return value 148 151 EXAMPLE: example pmat; shows an example 152 " 149 153 { 150 154 //------------- main case: input is a matrix, no second argument--------------- … … 212 216 213 217 proc rMacaulay 214 USAGE: rMacaulay(s[,n]); s string, n integer218 "USAGE: rMacaulay(s[,n]); s string, n integer 215 219 RETURN: a string which should be readable by Singular if s is a string read 216 220 by Singular from a file which was produced by Macaulay_1 (='Macaulay … … 221 225 from the screen, the character \ is treated differently 222 226 EXAMPLE: example rMacaulay; shows an example 227 " 223 228 { 224 229 int n; … … 335 340 336 341 proc show (id, list #) 337 USAGE: show(id); id any object of basering or of type ring/qring342 "USAGE: show(id); id any object of basering or of type ring/qring 338 343 show(R,s); R=ring, s=string (s = name of an object belonging to R) 339 344 DISPLAY: display id/s in a compact format together with some information … … 345 350 CAUTION: show(R,s) does not work inside a procedure 346 351 EXAMPLE: example show; shows an example 352 " 347 353 { 348 354 //------------- use funny names in order to avoid name conflicts -------------- … … 515 521 516 522 proc showrecursive (id,poly p,list #) 517 USAGE: showrecursive(id,p[ord]); id=any object of basering, p=product of523 "USAGE: showrecursive(id,p[ord]); id=any object of basering, p=product of 518 524 variables and ord=string (any allowed ordstr) 519 525 DISPLAY: display 'id' in a recursive format as a polynomial in the variables 520 526 occuring in p with coefficients in the remaining variables. Do this 521 527 by mapping in a ring with parameters [and ordering 'ord', if a 3rd 522 argument is present (default: ord= "dp")] and applying procedure 'show'528 argument is present (default: ord=\"dp\")] and applying procedure 'show' 523 529 RETURN: no return value 524 530 EXAMPLE: example showrecursive; shows an example 531 " 525 532 { 526 533 def P = basering; … … 558 565 559 566 proc split (string s, list #) 560 USAGE: split(s[,n]); s string, n integer567 "USAGE: split(s[,n]); s string, n integer 561 568 RETURN: same string, split into lines of length n separated by \ 562 569 (default: n=pagewidth) 563 570 NOTE: may be used in connection with lprint 564 571 EXAMPLE: example split; shows an example 572 " 565 573 { 566 574 string line,re; int p,l; … … 596 604 597 605 proc tab (int n) 598 USAGE: tab(n); n integer606 "USAGE: tab(n); n integer 599 607 RETURN: string of n space tabs 600 608 EXAMPLE: example tab; shows an example 609 " 601 610 { 602 611 if( n==0 ) { return(""); } … … 612 621 613 622 proc writelist (string fil, string nam, list L) 614 USAGE: writelist(fil,nam,L); fil,nam=strings (file-name, list-name), L=list623 "USAGE: writelist(fil,nam,L); fil,nam=strings (file-name, list-name), L=list 615 624 CREATE: a file with name `fil`, write the content of the list L into it and 616 625 call the list `nam`. … … 618 627 NOTE: The syntax of writelist uses and is similar to the syntax of the 619 628 write command of Singular which does not manage lists properly. 620 If, say, (fil,nam) = ( "listfile","L1"), writelist creates (resp.629 If, say, (fil,nam) = (\"listfile\",\"L1\"), writelist creates (resp. 621 630 appends if listfile exists) a file with name listfile and stores 622 631 there the list L under the name L1. The Singular command 623 execute(read( "listfile")); assignes the content of L (stored in632 execute(read(\"listfile\")); assignes the content of L (stored in 624 633 listfile) to a list L1. 625 On a UNIX system, overwrite an existing file if fil= ">...", resp.626 append if fil= ">>...".634 On a UNIX system, overwrite an existing file if fil=\">...\", resp. 635 append if fil=\">>...\". 627 636 EXAMPLE: example writelist; shows an example 637 " 628 638 { 629 639 int i; -
Singular/LIB/invar.lib
r4996f52 rd2b2a7 1 // $Id: invar.lib,v 1. 5 1998-04-03 22:47:07krueger Exp $1 // $Id: invar.lib,v 1.6 1998-05-05 11:55:30 krueger Exp $ 2 2 /////////////////////////////////////////////////////// 3 3 // invar.lib … … 7 7 ////////////////////////////////////////////////////// 8 8 9 version="$Id: invar.lib,v 1. 5 1998-04-03 22:47:07krueger Exp $";9 version="$Id: invar.lib,v 1.6 1998-05-05 11:55:30 krueger Exp $"; 10 10 info=" 11 11 LIBRARY: invar.lib PROCEDURES FOR COMPUTING INVARIANTS OF (C,+)-ACTIONS … … 63 63 64 64 proc der (matrix m, poly f) 65 USAGE: der(m,f); m matrix, f poly65 "USAGE: der(m,f); m matrix, f poly 66 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 68 NOTE: 69 69 EXAMPLE: example der; shows an example 70 " 70 71 { 71 72 matrix mh=matrix(jacob(f))*m; … … 88 89 89 90 proc actionIsProper(matrix m) 90 USAGE: actionIsProper(m); m matrix91 "USAGE: actionIsProper(m); m matrix 91 92 RETURN: int= 1 if is proper, 0 else 92 93 NOTE: 93 94 EXAMPLE: example actionIsProper; shows an example 95 " 94 96 { 95 97 int i; … … 146 148 147 149 proc reduction(poly p, ideal dom, list #) 148 USAGE: reduction(p,dom,q); p poly, dom ideal, q (optional) monomial150 "USAGE: reduction(p,dom,q); p poly, dom ideal, q (optional) monomial 149 151 RETURN: poly= (p-H(f1,...,fr))/q^a, if Lt(p)=H(Lt(f1),...,Lt(fr)) for 150 152 some polynomial H in r variables over the base field, … … 153 155 NOTE: 154 156 EXAMPLE: example reduction; shows an example 157 " 155 158 { 156 159 int i; … … 221 224 222 225 proc completeReduction(poly p, ideal dom, list #) 223 USAGE: completeReduction(p,dom,q); p poly, dom ideal,226 "USAGE: completeReduction(p,dom,q); p poly, dom ideal, 224 227 q (optional) monomial 225 228 RETURN: poly= the polynomial p reduced with dom via the procedure … … 227 230 NOTE: 228 231 EXAMPLE: example completeReduction; shows an example 232 " 229 233 { 230 234 poly p1=p; … … 248 252 249 253 proc inSubring(poly p, ideal dom) 250 USAGE: inSubring(p,dom); p poly, dom ideal254 "USAGE: inSubring(p,dom); p poly, dom ideal 251 255 RETURN: list= 1,string(@(0)-h(@(1),...,@(size(dom)))) :if p = h(dom[1],...,dom[size(dom)]) 252 256 0,string(h(@(0),...,@(size(dom)))) :if there is only a nonlinear relation … … 254 258 NOTE: 255 259 EXAMPLE: example inSubring; shows an example 260 " 256 261 { 257 262 int z=size(dom); … … 309 314 310 315 proc localInvar(matrix m, poly p, poly q, poly h) 311 USAGE: localInvar(m,p,q,h); m matrix, p,q,h poly316 "USAGE: localInvar(m,p,q,h); m matrix, p,q,h poly 312 317 RETURN: poly= the invariant of the vectorfield m=Sum m[i,1]*d/dx(i) with respect 313 318 to p,q,h, i.e. … … 317 322 NOTE: 318 323 EXAMPLE: example localInvar; shows an example 324 " 319 325 { 320 326 if ((der(m,h) !=0) || (der(m,der(m,q)) !=0)) … … 360 366 361 367 proc furtherInvar(matrix m, ideal id, ideal karl, poly q) 362 USAGE: furtherInvar(m,id,karl,q); m matrix, id,karl ideal,q poly368 "USAGE: furtherInvar(m,id,karl,q); m matrix, id,karl ideal,q poly 363 369 RETURN: ideal= further invariants of the vectorfield m=Sum m[i,1]*d/dx(i) with respect 364 370 to id,p,q, i.e. … … 371 377 NOTE: 372 378 EXAMPLE: example furtherInvar; shows an example 379 " 373 380 { 374 381 int i; … … 453 460 454 461 proc invariantRing(matrix m, poly p, poly q,list #) 455 USAGE: invariantRing(m,p,q); m matrix, p,q poly462 "USAGE: invariantRing(m,p,q); m matrix, p,q poly 456 463 RETURN: ideal= the invariants of the vectorfield m=Sum m[i,1]*d/dx(i) 457 464 p,q variables with m(p)=q invariant 458 465 NOTE: 459 466 EXAMPLE: example furtherInvar; shows an example 467 " 460 468 { 461 469 ideal j; -
Singular/LIB/makedbm.lib
r4996f52 rd2b2a7 1 // $Id: makedbm.lib,v 1. 6 1998-04-03 23:18:16krueger Exp $1 // $Id: makedbm.lib,v 1.7 1998-05-05 11:55:31 krueger 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 $"; 9 info=" 8 10 LIBRARY: makedbm.lib some usefull tools needed by the Arnold-Classifier. 9 11 … … 12 14 create_sing_dbm(); 13 15 read_sing_dbm(); 16 "; 14 17 15 18 //============================================================================= -
Singular/LIB/matrix.lib
r4996f52 rd2b2a7 1 // $Id: matrix.lib,v 1. 5 1998-04-03 22:47:08krueger Exp $1 // $Id: matrix.lib,v 1.6 1998-05-05 11:55:31 krueger Exp $ 2 2 // (GMG/BM, last modified 22.06.96) 3 3 /////////////////////////////////////////////////////////////////////////////// 4 4 5 version="$Id: matrix.lib,v 1. 5 1998-04-03 22:47:08krueger Exp $";5 version="$Id: matrix.lib,v 1.6 1998-05-05 11:55:31 krueger Exp $"; 6 6 info=" 7 7 LIBRARY: matrix.lib PROCEDURES FOR MATRIX OPERATIONS … … 38 38 39 39 proc compress (A) 40 USAGE: compress(A); A matrix/ideal/module/intmat/intvec40 "USAGE: compress(A); A matrix/ideal/module/intmat/intvec 41 41 RETURN: same type, zero columns/generators from A deleted 42 42 (in an intvec zero elements are deleted) 43 43 EXAMPLE: example compress; shows an example 44 " 44 45 { 45 46 if( typeof(A)=="matrix" ) { return(matrix(simplify(A,2))); } … … 79 80 //////////////////////////////////////////////////////////////////////////////// 80 81 proc concat (list #) 81 USAGE: concat(A1,A2,..); A1,A2,... matrices82 "USAGE: concat(A1,A2,..); A1,A2,... matrices 82 83 RETURN: matrix, concatenation of A1,A2,... . Number of rows of result matrix is 83 84 max(nrows(A1),nrows(A2),...) 84 85 EXAMPLE: example concat; shows an example 86 " 85 87 { 86 88 int i; … … 102 104 103 105 proc diag (list #) 104 USAGE: diag(p,n); p poly, n integer106 "USAGE: diag(p,n); p poly, n integer 105 107 diag(A); A matrix 106 108 RETURN: diag(p,n): diagonal matrix, p times unitmatrix of size n … … 108 110 nxm matrix A, taken from the 1st row, 2nd row etc of A 109 111 EXAMPLE: example diag; shows an example 112 " 110 113 { 111 114 if( size(#)==2 ) { return(matrix(#[1]*freemodule(#[2]))); } … … 129 132 130 133 proc dsum (list #) 131 USAGE: dsum(A1,A2,..); A1,A2,... matrices134 "USAGE: dsum(A1,A2,..); A1,A2,... matrices 132 135 RETURN: matrix, direct sum of A1,A2,... 133 136 EXAMPLE: example dsum; shows an example 137 " 134 138 { 135 139 int i,N,a; … … 159 163 160 164 proc flatten (matrix A) 161 USAGE: flatten(A); A matrix165 "USAGE: flatten(A); A matrix 162 166 RETURN: ideal, generated by all entries from A 163 167 EXAMPLE: example flatten; shows an example 168 " 164 169 { 165 170 return(ideal(A)); … … 175 180 176 181 proc genericmat (int n,int m,list #) 177 USAGE: genericmat(n,m[,id]); n,m=integers, id=ideal182 "USAGE: genericmat(n,m[,id]); n,m=integers, id=ideal 178 183 RETURN: nxm matrix, with entries from id (default: id=maxideal(1)) 179 184 NOTE: if id has less than nxm elements, the matrix is filled with 0's, 180 185 genericmat(n,m); creates the generic nxm matrix 181 186 EXAMPLE: example genericmat; shows an example 187 " 182 188 { 183 189 if( size(#)==0 ) { ideal id=maxideal(1); } … … 202 208 203 209 proc is_complex (list c) 204 USAGE: is_complex(c); c = list of size-compatible modules or matrices210 "USAGE: is_complex(c); c = list of size-compatible modules or matrices 205 211 RETURN: 1 if c[i]*c[i+1]=0 for all i, 0 if not. 206 212 NOTE: Ideals are treated internally as 1-line matrices 207 213 EXAMPLE: example is_complex; shows an example 214 " 208 215 { 209 216 int i; … … 234 241 235 242 proc outer (matrix A, matrix B) 236 USAGE: outer(A,B); A,B matrices243 "USAGE: outer(A,B); A,B matrices 237 244 RETURN: matrix, outer product of A and B 238 245 EXAMPLE: example outer; shows an example 246 " 239 247 { 240 248 int i,j; list L; … … 271 279 272 280 proc power ( A, int n) 273 USAGE: power(A,n); A a square-matrix of type intmat or matrix, n=integer281 "USAGE: power(A,n); A a square-matrix of type intmat or matrix, n=integer 274 282 RETURN: inmat resp. matrix, the n-th power of A 275 283 NOTE: for intamt and big n the result may be wrong because of int overflow 276 284 EXAMPLE: example power; shows an example 285 " 277 286 { 278 287 //---------------------------- type checking ---------------------------------- … … 346 355 347 356 proc skewmat (int n, list #) 348 USAGE: skewmat(n[,id]); n integer, id ideal357 "USAGE: skewmat(n[,id]); n integer, id ideal 349 358 RETURN: skew-symmetric nxn matrix, with entries from id 350 359 (default: id=maxideal(1)) … … 352 361 skewmat(n); creates the generic skew-symmetric matrix 353 362 EXAMPLE: example skewmat; shows an example 363 " 354 364 { 355 365 matrix B[n][n]; … … 382 392 383 393 proc submat (matrix A, intvec r, intvec c) 384 USAGE: submat(A,r,c); A=matrix, r,c=intvec394 "USAGE: submat(A,r,c); A=matrix, r,c=intvec 385 395 RETURN: matrix, submatrix of A with rows specified by intvec r and columns 386 396 specified by intvec c 387 397 EXAMPLE: example submat; shows an example 398 " 388 399 { 389 400 matrix B[size(r)][size(c)]=A[r,c]; … … 402 413 403 414 proc symmat (int n, list #) 404 USAGE: symmat(n[,id]); n integer, id ideal415 "USAGE: symmat(n[,id]); n integer, id ideal 405 416 RETURN: symmetric nxn matrix, with entries from id (default: id=maxideal(1)) 406 417 NOTE: if id has less than n*(n+1)/2 elements, the matrix is filled with 0's, 407 418 symmat(n); creates the generic symmetric matrix 408 419 EXAMPLE: example symmat; shows an example 420 " 409 421 { 410 422 matrix B[n][n]; … … 438 450 439 451 proc tensor (matrix A, matrix B) 440 USAGE: tensor(A,B); A,B matrices452 "USAGE: tensor(A,B); A,B matrices 441 453 RETURN: matrix, tensor product of A and B 442 454 EXAMPLE: example tensor; shows an example 455 " 443 456 { 444 457 int i,j; … … 467 480 468 481 proc unitmat (int n) 469 USAGE: unitmat(n); n integer >= 0482 "USAGE: unitmat(n); n integer >= 0 470 483 RETURN: nxn unit matrix 471 484 NOTE: needs a basering, diagonal entries are numbers (=1) in the basering 472 485 EXAMPLE: example unitmat; shows an example 486 " 473 487 { 474 488 return(matrix(freemodule(n))); … … 483 497 484 498 proc gauss_col (matrix A) 485 USAGE: gauss_col(A); A=matrix with constant coefficients499 "USAGE: gauss_col(A); A=matrix with constant coefficients 486 500 RETURN: matrix = col-reduced lower-triagonal normal form of A 487 501 NOTE: the procedure sets the global option-command: option(noredSB); 488 502 EXAMPLE: example gauss_col; shows an example 503 " 489 504 { 490 505 def R=basering; … … 512 527 513 528 proc gauss_row (matrix A) 514 USAGE: gauss_row(A); A=matrix with constant coefficients529 "USAGE: gauss_row(A); A=matrix with constant coefficients 515 530 RETURN: matrix = row-reduced upper-triangular normal form of A 516 531 NOTE: may be used to solve a system of linear equations … … 518 533 the procedure sets the global option-command: option(noredSB); 519 534 EXAMPLE: example gauss_row; shows an example 535 " 520 536 { 521 537 A = gauss_col(transpose(A)); … … 534 550 535 551 proc addcol (matrix A, int c1, poly p, int c2) 536 USAGE: addcol(A,c1,p,c2); A matrix, p poly, c1, c2 positive integers552 "USAGE: addcol(A,c1,p,c2); A matrix, p poly, c1, c2 positive integers 537 553 RETURN: matrix, A being modified by adding p times column c1 to column c2 538 554 EXAMPLE: example addcol; shows an example 555 " 539 556 { 540 557 A[1..nrows(A),c2]=A[1..nrows(A),c2]+p*A[1..nrows(A),c1]; … … 551 568 552 569 proc addrow (matrix A, int r1, poly p, int r2) 553 USAGE: addcol(A,r1,p,r2); A matrix, p poly, r1, r2 positive integers570 "USAGE: addcol(A,r1,p,r2); A matrix, p poly, r1, r2 positive integers 554 571 RETURN: matrix, A being modified by adding p times row r1 to row r2 555 572 EXAMPLE: example addrow; shows an example 573 " 556 574 { 557 575 A[r2,1..ncols(A)]=A[r2,1..ncols(A)]+p*A[r1,1..ncols(A)]; … … 568 586 569 587 proc multcol (matrix A, int c, poly p) 570 USAGE: addcol(A,c,p); A matrix, p poly, c positive integer588 "USAGE: addcol(A,c,p); A matrix, p poly, c positive integer 571 589 RETURN: matrix, A being modified by multiplying column c with p 572 590 EXAMPLE: example multcol; shows an example 591 " 573 592 { 574 593 A[1..nrows(A),c]=p*A[1..nrows(A),c]; … … 585 604 586 605 proc multrow (matrix A, int r, poly p) 587 USAGE: addcol(A,r,p); A matrix, p poly, r positive integer606 "USAGE: addcol(A,r,p); A matrix, p poly, r positive integer 588 607 RETURN: matrix, A being modified by multiplying row r with p 589 608 EXAMPLE: example multrow; shows an example 609 " 590 610 { 591 611 A[r,1..ncols(A)]=p*A[r,1..ncols(A)]; … … 602 622 603 623 proc permcol (matrix A, int c1, int c2) 604 USAGE: permcol(A,c1,c2); A matrix, c1,c2 positive integers624 "USAGE: permcol(A,c1,c2); A matrix, c1,c2 positive integers 605 625 RETURN: matrix, A being modified by permuting column c1 and c2 606 626 EXAMPLE: example permcol; shows an example 627 " 607 628 { 608 629 matrix B=A; … … 621 642 622 643 proc permrow (matrix A, int r1, int r2) 623 USAGE: permrow(A,r1,r2); A matrix, r1,r2 positive integers644 "USAGE: permrow(A,r1,r2); A matrix, r1,r2 positive integers 624 645 RETURN: matrix, A being modified by permuting row r1 and r2 625 646 EXAMPLE: example permrow; shows an example 647 " 626 648 { 627 649 matrix B=A; -
Singular/LIB/normal.lib
r4996f52 rd2b2a7 6 6 /////////////////////////////////////////////////////////////////////////////// 7 7 8 version="$Id: normal.lib,v 1. 4 1998-04-03 22:47:08krueger Exp $";8 version="$Id: normal.lib,v 1.5 1998-05-05 11:55:32 krueger Exp $"; 9 9 info=" 10 10 LIBRARY: normal.lib: PROCEDURE FOR NORMALIZATION (I) … … 22 22 23 23 proc isR_HomJR (list Li) 24 USAGE: isR_HomJR (Li); Li = list: ideal SBid, ideal J, poly p24 "USAGE: isR_HomJR (Li); Li = list: ideal SBid, ideal J, poly p 25 25 COMPUTE: module Hom_R(J,R) = R:J and compare with R 26 26 ASSUME: R = P/SBid, P = basering … … 30 30 RETURN: 1 if R = R:J, 0 if not 31 31 EXAMPLE: example isR_HomJR; shows an example 32 " 32 33 { 33 34 int n, ii; … … 71 72 72 73 proc extraweight (list # ) 73 USAGE: extraweight (P); P=name of an existing ring (true name, not a string)74 "USAGE: extraweight (P); P=name of an existing ring (true name, not a string) 74 75 RETURN: intvec, size=nvars(P), consisting of the weights of the variables of P 75 76 NOTE: This is useful when enlarging P but keeping the weights of the old 76 77 variables 77 78 EXAMPLE: example extraweight; shows an example 79 " 78 80 { 79 81 int ii,q,fi,fo,fia; … … 152 154 153 155 proc HomJJ (list Li,list #) 154 USAGE: HomJJ (Li); Li = list: SBid,id,J,poly p156 "USAGE: HomJJ (Li); Li = list: SBid,id,J,poly p 155 157 ASSUME: R = P/id, P = basering, a polynomial ring, id an ideal of P, 156 158 SBid = standard basis of id, … … 165 167 _[2]: an integer which is 1 if phi is an isomorphism, 0 if not 166 168 EXAMPLE: example HomJJ; shows an example 169 " 167 170 { 168 171 //---------- initialisation --------------------------------------------------- … … 513 516 /////////////////////////////////////////////////////////////////////////////// 514 517 proc normal(ideal id, list #) 515 USAGE: normal(i,choose); i ideal,choose empty or 1518 "USAGE: normal(i,choose); i ideal,choose empty or 1 516 519 in case you choose 1 the factorizing Buchberger algorithm 517 520 is not used which is sometimes more efficient … … 521 524 NOTE: to use the rings: def r=L[i];setring r; 522 525 EXAMPLE: example normal; shows an example 526 " 523 527 { 524 528 int i,j,y; … … 654 658 655 659 proc normalizationPrimes(ideal i,ideal ihp, list #) 656 USAGE: normalizationPrimes(i); i prime ideal660 "USAGE: normalizationPrimes(i); i prime ideal 657 661 RETURN: a list of one ring L=R, in R are two ideals 658 662 S,M such that R/M is the normalization … … 660 664 NOTE: to use the ring: def r=L[1];setring r; 661 665 EXAMPLE: example normalizationPrimes; shows an example 666 " 662 667 { 663 668 int y; -
Singular/LIB/poly.lib
r4996f52 rd2b2a7 1 // $Id: poly.lib,v 1.1 1 1998-04-06 17:59:38 obachmanExp $1 // $Id: poly.lib,v 1.12 1998-05-05 11:55:33 krueger 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 1 1998-04-06 17:59:38 obachmanExp $";7 version="$Id: poly.lib,v 1.12 1998-05-05 11:55:33 krueger Exp $"; 8 8 info=" 9 9 LIBRARY: poly.lib PROCEDURES FOR MANIPULATING POLYS, IDEALS, MODULES … … 30 30 31 31 proc cyclic (int n) 32 USAGE: cyclic(n); n integer32 "USAGE: cyclic(n); n integer 33 33 RETURN: ideal of cyclic n-roots from 1-st n variables of basering 34 34 EXAMPLE: example cyclic; shows examples 35 " 35 36 { 36 37 //----------------------------- procedure body -------------------------------- … … 58 59 59 60 proc katsura 60 USAGE: katsura([n]); n integer61 "USAGE: katsura([n]); n integer 61 62 RETURN: katsura(n) : n-th katsura ideal of newly created and set ring 62 63 (32003, x(0..n), dp) 63 64 katsura() : katsura ideal of basering 64 65 EXAMPLE: example katsura; shows examples 66 " 65 67 { 66 68 if ( size(#) == 1 && typeof(#[1]) == "int") … … 111 113 112 114 proc freerank 113 USAGE: freerank(M[,any]); M=poly/ideal/vector/module/matrix115 "USAGE: freerank(M[,any]); M=poly/ideal/vector/module/matrix 114 116 COMPUTE: rank of module presented by M in case it is free. By definition this 115 117 is vdim(coker(M)/m*coker(M)) if coker(M) is free, where m = maximal … … 124 126 //betti(0) ist -1 statt 0 125 127 EXAMPLE: example freerank; shows examples 128 " 126 129 { 127 130 int rk; … … 148 151 149 152 proc is_homog (id) 150 USAGE: is_homog(id); id poly/ideal/vector/module/matrix153 "USAGE: is_homog(id); id poly/ideal/vector/module/matrix 151 154 RETURN: integer which is 1 if input is homogeneous (resp. weighted homogeneous 152 155 if the monomial ordering consists of one block of type ws,Ws,wp or Wp, … … 157 160 //*** ergaenzen, wenn Matrizen-Spalten Gewichte haben 158 161 EXAMPLE: example is_homog; shows examples 162 " 159 163 { 160 164 //----------------------------- procedure body -------------------------------- … … 186 190 187 191 proc is_zero 188 USAGE: is_zero(M[,any]); M=poly/ideal/vector/module/matrix192 "USAGE: is_zero(M[,any]); M=poly/ideal/vector/module/matrix 189 193 RETURN: integer, 1 if coker(M)=0 resp. 0 if coker(M)!=0, where M is considered 190 194 as matrix … … 193 197 L[2] = dim(M) 194 198 EXAMPLE: example is_zero; shows examples 199 " 195 200 { 196 201 int d=dim(std(#[1])); … … 211 216 212 217 proc maxcoef (f) 213 USAGE: maxcoef(f); f poly/ideal/vector/module/matrix218 "USAGE: maxcoef(f); f poly/ideal/vector/module/matrix 214 219 RETURN: maximal length of coefficient of f of type int (by counting the 215 220 length of the string of each coefficient) 216 221 EXAMPLE: example maxcoef; shows examples 222 " 217 223 { 218 224 //----------------------------- procedure body -------------------------------- … … 247 253 248 254 proc maxdeg (id) 249 USAGE: maxdeg(id); id poly/ideal/vector/module/matrix255 "USAGE: maxdeg(id); id poly/ideal/vector/module/matrix 250 256 RETURN: int/intmat, each component equals maximal degree of monomials in the 251 257 corresponding component of id, independent of ring ordering … … 255 261 an option for computing weighted degrees 256 262 EXAMPLE: example maxdeg; shows examples 263 " 257 264 { 258 265 //-------- subprocedure to find maximal degree of given component ---------- … … 300 307 301 308 proc maxdeg1 (id,list #) 302 USAGE: maxdeg1(id[,v]); id=poly/ideal/vector/module/matrix, v=intvec309 "USAGE: maxdeg1(id[,v]); id=poly/ideal/vector/module/matrix, v=intvec 303 310 RETURN: integer, maximal [weighted] degree of monomials of id independent of 304 311 ring ordering, maxdeg1 of i-th variable is v[i] (default: v=1..1). … … 307 314 maxdeg is faster 308 315 EXAMPLE: example maxdeg1; shows examples 316 " 309 317 { 310 318 //-------- subprocedure to find maximal degree of given component ---------- … … 381 389 382 390 proc mindeg (id) 383 USAGE: mindeg(id); id poly/ideal/vector/module/matrix391 "USAGE: mindeg(id); id poly/ideal/vector/module/matrix 384 392 RETURN: minimal degree/s of monomials of id, independent of ring ordering 385 393 (mindeg of each variable is 1) of type int if id of type poly, else … … 388 396 has an option for computing weighted degrees. 389 397 EXAMPLE: example mindeg; shows examples 398 " 390 399 { 391 400 //--------- subprocedure to find minimal degree of given component --------- … … 434 443 435 444 proc mindeg1 (id, list #) 436 USAGE: mindeg1(id[,v]); id=poly/ideal/vector/module/matrix, v=intvec445 "USAGE: mindeg1(id[,v]); id=poly/ideal/vector/module/matrix, v=intvec 437 446 RETURN: integer, minimal [weighted] degree of monomials of id independent of 438 447 ring ordering, mindeg1 of i-th variable is v[i] (default v=1..1). … … 441 450 mindeg is faster. 442 451 EXAMPLE: example mindeg1; shows examples 452 " 443 453 { 444 454 //--------- subprocedure to find minimal degree of given component --------- … … 514 524 515 525 proc normalize (id) 516 USAGE: normalize(id); id=poly/vector/ideal/module526 "USAGE: normalize(id); id=poly/vector/ideal/module 517 527 RETURN: object of same type with leading coefficient equal to 1 518 528 EXAMPLE: example normalize; shows an example 529 " 519 530 { 520 531 return(simplify(id,1)); … … 543 554 //////////////////////////////////////////////////////////////////////////////// 544 555 proc rad_con (poly g,ideal I) 545 USAGE: rad_con(<poly>,<ideal>);556 " USAGE: rad_con(<poly>,<ideal>); 546 557 RETURNS: 1 (TRUE) (type <int>) if <poly> is contained in the radical of 547 558 <ideal>, 0 (FALSE) (type <int>) otherwise 548 559 EXAMPLE: example rad_con; shows an example 560 " 549 561 { def br=basering; 550 562 int n=nvars(br); … … 582 594 583 595 proc lcm (ideal i) 584 USAGE: lcm(i); i ideal596 "USAGE: lcm(i); i ideal 585 597 RETURN: poly = lcm(i[1],...,i[size(i)]) 586 598 NOTE: 587 599 EXAMPLE: example lcm; shows an example 600 " 588 601 { 589 602 int k,j; … … 636 649 637 650 proc content(f) 638 USAGE: content(f); f polynomial/vector651 "USAGE: content(f); f polynomial/vector 639 652 RETURN: number, the content (greatest common factor of coefficients) 640 653 of the polynomial/vector f 641 654 EXAMPLE: example content; shows an example 655 " 642 656 { 643 657 return(leadcoef(f)/leadcoef(cleardenom(f))); -
Singular/LIB/presolve.lib
r4996f52 rd2b2a7 1 // $Id: presolve.lib,v 1. 3 1998-04-03 22:47:10krueger Exp $1 // $Id: presolve.lib,v 1.4 1998-05-05 11:55:34 krueger 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. 3 1998-04-03 22:47:10krueger Exp $";6 version="$Id: presolve.lib,v 1.4 1998-05-05 11:55:34 krueger Exp $"; 7 7 info=" 8 8 LIBRARY: presolve.lib PROCEDURES FOR PRE-SOLVING POLYNOMIAL EQUATIONS … … 32 32 33 33 proc degreepart (id,int d1,int d2,list #) 34 USAGE: degreepart(id,d1,d2[,v]); id=ideal/module, d1,d1=integers, v=intvec34 "USAGE: degreepart(id,d1,d2[,v]); id=ideal/module, d1,d1=integers, v=intvec 35 35 RETURN: generators of id of [v-weighted] total degree >= d1 and <= d2 36 36 (default: v = 1,...,1) 37 37 EXAMPLE: example degreepart; shows an example 38 " 38 39 { 39 40 def dpart = id; … … 67 68 68 69 proc elimlinearpart (ideal i,list #) 69 USAGE: elimlinearpart(i[,n]); i=ideal, n=integer70 "USAGE: elimlinearpart(i[,n]); i=ideal, n=integer 70 71 RETURN: list of of 5 objects: 71 72 [1]: (interreduced) ideal obtained from i by eliminating (sbstituting) … … 82 83 // bei ** spaeter eventuell verbessern 83 84 EXAMPLE: example elimlinearpart; shows an example 85 " 84 86 { 85 87 int ii,n,fi,k; … … 171 173 172 174 proc elimpart (ideal i,list #) 173 USAGE: elimpart(i[,n,e]); i=ideal, n,e=integers175 "USAGE: elimpart(i[,n,e]); i=ideal, n,e=integers 174 176 consider 1-st n vars for elimination (better: substitution), 175 177 e =0: substitute from linear part of i (same as elimlinearpart) … … 191 193 since it avoids internal ring change and mapping 192 194 EXAMPLE: example elimpart; shows an example 195 " 193 196 { 194 197 def P = basering; … … 315 318 316 319 proc elimpartanyr (ideal i, list #) 317 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, 318 321 e=int (default: p=product of all vars, e=1) 319 322 RETURN: list of of 6 objects: … … 334 337 placed correctly and then applies 'elimpart'; 335 338 EXAMPLE: example elimpartanyr; shows an example 339 " 336 340 { 337 341 def P = basering; … … 367 371 368 372 proc fastelim (ideal i, poly p, list #) 369 USAGE: fastelim(i,p[h,o,a,b,e,m]); i=ideal, p=product of variables to be373 "USAGE: fastelim(i,p[h,o,a,b,e,m]); i=ideal, p=product of variables to be 370 374 eliminated; h,o,a,b,e integers 371 375 (options for Hilbert-std, 'valvars', elimpart, minimizing) … … 380 384 RETURN: ideal obtained from i by eliminating those variables which occur in p 381 385 EXAMPLE: example fastelim; shows an example. 386 " 382 387 { 383 388 def P = basering; … … 455 460 456 461 proc faststd (@id,string @s1,string @s2, list #) 457 USAGE: faststd(id,s1,s2[,"hilb","sort","dec",o,"blocks"]);462 "USAGE: faststd(id,s1,s2[,\"hilb\",\"sort\",\"dec\",o,\"blocks\"]); 458 463 id=ideal/module, s1,s2=strings (names for new ring and maped id) 459 o = string (allowed ordstring: "lp","dp","Dp","ls","ds","Ds")460 "hilb","sort","dec","block" options for Hilbert-std, sortandmap461 COMPUTE: create a new ring (with "best" ordering of vars) and compute a464 o = string (allowed ordstring:\"lp\",\"dp\",\"Dp\",\"ls\",\"ds\",\"Ds\") 465 \"hilb\",\"sort\",\"dec\",\"block\" options for Hilbert-std, sortandmap 466 COMPUTE: create a new ring (with \"best\" ordering of vars) and compute a 462 467 std-basis of id (hopefully faster) 463 - If say, s1= "R" and s2="j", the new basering has name R and the468 - If say, s1=\"R\" and s2=\"j\", the new basering has name R and the 464 469 std-basis of the image of id in R has name j 465 - "hilb" : use Hilbert-series driven std-basis computation466 - "sort" : use 'sortandmap' for a best ordering of vars467 - "dec" : order vars w.r.t. decreasing complexity (with "sort")468 - "block" : create blockordering, each block having ordstr=o, s.t.469 vars of same complexity are in one block (with "sort")470 - \"hilb\" : use Hilbert-series driven std-basis computation 471 - \"sort\" : use 'sortandmap' for a best ordering of vars 472 - \"dec\" : order vars w.r.t. decreasing complexity (with \"sort\") 473 - \"block\" : create blockordering, each block having ordstr=o, s.t. 474 vars of same complexity are in one block (with \"sort\") 470 475 - o : defines the basic ordering of the resulting ring 471 476 default: o = ordering of 1-st block of basering - if it is allowed, 472 else o= "dp",473 "sort", if none of the optional parameters is given477 else o=\"dp\", 478 \"sort\", if none of the optional parameters is given 474 479 RETURN: nothing 475 480 NOTE: This proc is only useful for hard problems where other methods fail. 476 "hilb" is useful for hard orderings (as "lp") or for characteristic 0,477 it is correct for "lp","dp","Dp" (and for blockorderings combining481 \"hilb\" is useful for hard orderings (as \"lp\") or for characteristic 0, 482 it is correct for \"lp\",\"dp\",\"Dp\" (and for blockorderings combining 478 483 these) but not for s-orderings or if the vars have different weights. 479 There seem to be only few cases in which "dec" is fast484 There seem to be only few cases in which \"dec\" is fast 480 485 EXAMPLE: example faststd; shows an example. 486 " 481 487 { 482 488 def @P = basering; … … 624 630 625 631 proc findvars(id, list #) 626 USAGE: findvars(id[,any]); id poly/ideal/vector/module/matrix, any=any type632 "USAGE: findvars(id[,any]); id poly/ideal/vector/module/matrix, any=any type 627 633 RETURN: ideal of variables occuring in id, if no second argument is present 628 634 list of 4 objects, if a second argument is given (of any type) … … 632 638 -[4]: intvec of variables not occuring in id 633 639 EXAMPLE: example findvars; shows an example 640 " 634 641 { 635 642 int ii,n; … … 670 677 671 678 proc hilbvec (@id, list #) 672 USAGE: hilbvec(id[,c,o]); id poly/ideal/vector/module/matrix, c,o=strings673 c=char, o=ord in which hilb is computed (default: c= "32003", o="dp")679 "USAGE: hilbvec(id[,c,o]); id poly/ideal/vector/module/matrix, c,o=strings 680 c=char, o=ord in which hilb is computed (default: c=\"32003\", o=\"dp\") 674 681 RETURN: intvec of 1-st Hilbert-series of id, computed in char c and ordering o 675 682 bei ** aendern falls ringmaps vollstaendig ? 676 683 NOTE: id must be homogeneous (all vars having weight 1) 677 684 EXAMPLE: example hilbvec; shows an example 685 " 678 686 { 679 687 def @P = basering; … … 701 709 702 710 proc linearpart (id) 703 USAGE: linearpart(id); id=ideal/module711 "USAGE: linearpart(id); id=ideal/module 704 712 RETURN: generators of id of total degree <= 1 705 713 EXAMPLE: example linearpart; shows an example 714 " 706 715 { 707 716 return(degreepart(id,0,1)); … … 718 727 719 728 proc tolessvars (id ,list #) 720 USAGE: tolessvars(id,[s1,s2]); id poly/ideal/vector/module/matrix,729 "USAGE: tolessvars(id,[s1,s2]); id poly/ideal/vector/module/matrix, 721 730 s1,s2=strings (names of: new ring, new ordering) 722 731 CREATE: nothing, if id contains all vars of the basering. Else, create … … 725 734 new ring, which will be the basering after the proc has finished. 726 735 The name of the new ring is by default R(n), where n is the number of 727 variables in the new ring. If, say, s1 = "newR" then the new ring has736 variables in the new ring. If, say, s1 = \"newR\" then the new ring has 728 737 name newR. In s2 a different ordering for the new ring may be given 729 as an allowed ordstring (default is "dp" resp. "ds", depending whether738 as an allowed ordstring (default is \"dp\" resp. \"ds\", depending whether 730 739 the first block of the old ordering is a p- resp. an s-ordering). 731 740 DISPLAY: If printlevel >=0, display ideal of vars which have been ommitted from … … 739 748 occurs in the old ring, for the same reason. 740 749 EXAMPLE: example tolessvars; shows an example 750 " 741 751 { 742 752 //---------------- initialisation and check occurence of vars ----------------- … … 796 806 797 807 proc solvelinearpart (id,list #) 798 USAGE: solvelinearpart(id[,n]); id=ideal/module, n=integer808 "USAGE: solvelinearpart(id[,n]); id=ideal/module, n=integer 799 809 RETURN: (interreduced) generators of id of degree <=1 in reduced triangular 800 810 form (default) or if n=0 [non-reduced triangular form if n!=0] … … 805 815 char 0 instead! 806 816 EXAMPLE: example solvelinearpart; shows an example 817 " 807 818 { 808 819 intvec getoption = option(get); … … 855 866 856 867 proc sortandmap (@id,string @s1,string @s2, list #) 857 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...]); 858 869 id=poly/ideal/vector/module 859 870 s1,s2=strings (names for new ring and maped id) 860 871 p1,p2,...= product of vars, n1,n2,...=integers 861 872 o1,o2,...= allowed ordstrings, m1,m2,...=integers 862 (default: p1=product of all vars, n1=0, o1= "dp",m1=0)873 (default: p1=product of all vars, n1=0, o1=\"dp\",m1=0) 863 874 the last pi (containing the remaining vars) may be omitted 864 875 CREATE: a new ring and map id into it, the new ring has same char as basering … … 867 878 id, ni controls the sorting in i-th block (= vars occuring in pi): 868 879 ni=0 (resp.!=0) means that less (resp. more) complex vars come first 869 - If say, s1= "R" and s2="j", the new basering has name R and the image880 - If say, s1=\"R\" and s2=\"j\", the new basering has name R and the image 870 881 of id in R has name j 871 882 - oi and mi define the monomial ordering of the i-th block: … … 874 885 each subblock having ordstr=oi, such that vars of same complexity 875 886 are in one block 876 default: oi= "dp", mi=0877 - only simple ordstrings oi are allowed: "lp","dp","Dp","ls","ds","Ds"887 default: oi=\"dp\", mi=0 888 - only simple ordstrings oi are allowed:\"lp\",\"dp\",\"Dp\",\"ls\",\"ds\",\"Ds\" 878 889 RETURN: nothing 879 890 NOTE: We define a variable x to be more complex than y (with respect to id) … … 884 895 # of monomials in coefficient of next smaller power of x,...) 885 896 EXAMPLE: example sortandmap; shows an example 897 " 886 898 { 887 899 def @P = basering; … … 948 960 949 961 proc sortvars (id, list #) 950 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, 951 963 p1,p2,...= product of vars, n1,n2,...=integers 952 964 (default: p1=product of all vars, n1=0) … … 972 984 # of monomials in coefficient of next smaller power of x,...) 973 985 EXAMPLE: example sortvars; shows an example 986 " 974 987 { 975 988 int ii,jj,n,s; … … 1009 1022 1010 1023 proc valvars (id, list #) 1011 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, 1012 1025 p1,p2,...= product of vars, n1,n2,...=integers 1013 1026 ni controls the ordering of vars occuring in pi: … … 1032 1045 # of monomials in coefficient of next smaller power of x,...) 1033 1046 EXAMPLE: example valvars; shows an example 1047 " 1034 1048 { 1035 1049 //---------------------------- initialization --------------------------------- -
Singular/LIB/primdec.lib
r4996f52 rd2b2a7 1 // $Id: primdec.lib,v 1.1 2 1998-04-14 15:35:45 Singular Exp $1 // $Id: primdec.lib,v 1.13 1998-05-05 11:55:34 krueger Exp $ 2 2 /////////////////////////////////////////////////////// 3 3 // primdec.lib … … 11 11 ////////////////////////////////////////////////////// 12 12 13 version="$Id: primdec.lib,v 1.1 2 1998-04-14 15:35:45 Singular Exp $";13 version="$Id: primdec.lib,v 1.13 1998-05-05 11:55:34 krueger Exp $"; 14 14 info=" 15 15 LIBRARY: primdec.lib: PROCEDURE FOR PRIMARY DECOMPOSITION (I) … … 65 65 66 66 proc sat1 (ideal id, poly p) 67 USAGE: sat1(id,j); id ideal, j polynomial67 "USAGE: sat1(id,j); id ideal, j polynomial 68 68 RETURN: saturation of id with respect to j (= union_(k=1...) of id:j^k) 69 69 NOTE: result is a std basis in the basering 70 70 EXAMPLE: example sat; shows an example 71 " 71 72 { 72 73 int @k; … … 89 90 90 91 proc sat2 (ideal id, ideal h) 91 USAGE: sat2(id,j); id ideal, j polynomial92 "USAGE: sat2(id,j); id ideal, j polynomial 92 93 RETURN: saturation of id with respect to j (= union_(k=1...) of id:j^k) 93 94 NOTE: result is a std basis in the basering 94 95 EXAMPLE: example sat2; shows an example 96 " 95 97 { 96 98 int @k,@i; … … 283 285 284 286 proc factor(poly p) 285 USAGE: factor(p) p poly287 "USAGE: factor(p) p poly 286 288 RETURN: list=; 287 289 NOTE: 288 290 EXAMPLE: example factor; shows an example 291 " 289 292 { 290 293 … … 438 441 439 442 proc testPrimary(list pr, ideal k) 440 USAGE: testPrimary(pr,k) pr list, k ideal;443 "USAGE: testPrimary(pr,k) pr list, k ideal; 441 444 RETURN: int = 1, if the intersection of the ideals in pr is k, 0 if not 442 445 NOTE: 443 446 EEXAMPLE: example testPrimary ; shows an example 447 " 444 448 { 445 449 int i; … … 469 473 //////////////////////////////////////////////////////////////////////////////// 470 474 proc printPrimary( list l, list #) 471 USAGE: printPrimary(l) l list;475 "USAGE: printPrimary(l) l list; 472 476 RETURN: nothing 473 477 NOTE: 474 478 EXAMPLE: example printPrimary; shows an example 479 " 475 480 { 476 481 if(size(#)>0) … … 503 508 504 509 proc randomLast(int b) 505 USAGE: randomLast510 "USAGE: randomLast 506 511 RETURN: ideal = maxideal(1) but the last variable exchanged by 507 512 a sum of it with a linear random combination of the other … … 509 514 NOTE: 510 515 EXAMPLE: example randomLast; shows an example 516 " 511 517 { 512 518 … … 823 829 824 830 proc zero_decomp (ideal j,ideal ser,int @wr,list #) 825 USAGE: zero_decomp(j,ser,@wr); j,ser ideals, @wr=0 or 1831 "USAGE: zero_decomp(j,ser,@wr); j,ser ideals, @wr=0 or 1 826 832 (@wr=0 for primary decomposition, @wr=1 for computaion of associated 827 833 primes) … … 833 839 NOTE: Algorithm of Gianni, Traeger, Zacharias 834 840 EXAMPLE: example zero_decomp; shows an example 841 " 835 842 { 836 843 def @P = basering; … … 1224 1231 1225 1232 proc ggt (ideal i) 1226 USAGE: ggt(i); i list of polynomials1233 "USAGE: ggt(i); i list of polynomials 1227 1234 RETURN: poly = ggt(i[1],...,i[size(i)]) 1228 1235 NOTE: 1229 1236 EXAMPLE: example ggt; shows an example 1237 " 1230 1238 { 1231 1239 int k; … … 1313 1321 1314 1322 proc lcmP(ideal i) 1315 USAGE: lcm(i); i list of polynomials1323 "USAGE: lcm(i); i list of polynomials 1316 1324 RETURN: poly = lcm(i[1],...,i[size(i)]) 1317 1325 NOTE: 1318 1326 EXAMPLE: example lcm; shows an example 1327 " 1319 1328 { 1320 1329 int k,j; … … 1366 1375 /////////////////////////////////////////////////////////////////////////////// 1367 1376 proc clearSB (ideal i,list #) 1368 USAGE: clearSB(i); i ideal which is SB ordered by monomial ordering1377 "USAGE: clearSB(i); i ideal which is SB ordered by monomial ordering 1369 1378 RETURN: ideal = minimal SB 1370 1379 NOTE: 1371 1380 EXAMPLE: example clearSB; shows an example 1381 " 1372 1382 { 1373 1383 int k,j; … … 1444 1454 1445 1455 proc independSet (ideal j) 1446 USAGE: independentSet(i); i ideal1456 "USAGE: independentSet(i); i ideal 1447 1457 RETURN: list = new varstring with the independent set at the end, 1448 1458 ordstring with the corresponding block ordering, … … 1450 1460 NOTE: 1451 1461 EXAMPLE: example independentSet; shows an example 1462 " 1452 1463 { 1453 1464 int n,k,di; … … 1511 1522 1512 1523 proc maxIndependSet (ideal j) 1513 USAGE: maxIndependentSet(i); i ideal1524 "USAGE: maxIndependentSet(i); i ideal 1514 1525 RETURN: list = new varstring with the maximal independent set at the end, 1515 1526 ordstring with the corresponding block ordering, … … 1517 1528 NOTE: 1518 1529 EXAMPLE: example maxIndependentSet; shows an example 1530 " 1519 1531 { 1520 1532 int n,k,di; … … 1578 1590 1579 1591 proc prepareQuotientring (int nnp) 1580 USAGE: prepareQuotientring(nnp); nnp int1592 "USAGE: prepareQuotientring(nnp); nnp int 1581 1593 RETURN: string = to define Kvar(nnp+1),...,var(nvars)[..rest ] 1582 1594 NOTE: 1583 1595 EXAMPLE: example independentSet; shows an example 1596 " 1584 1597 { 1585 1598 ideal @ih,@jh; … … 1656 1669 1657 1670 proc minAssPrimes(ideal i, list #) 1658 USAGE: minAssPrimes(i); i ideal1671 "USAGE: minAssPrimes(i); i ideal 1659 1672 minAssPrimes(i,1); i ideal (to use also the factorizing Groebner) 1660 1673 RETURN: list = the minimal associated prime ideals of i 1661 1674 NOTE: 1662 1675 EXAMPLE: example minAssPrimes; shows an example 1676 " 1663 1677 { 1664 1678 #[1]=1; … … 1880 1894 /////////////////////////////////////////////////////////////////////////////// 1881 1895 proc decomp(ideal i,list #) 1882 USAGE: decomp(i); i ideal (for primary decomposition) (resp.1896 "USAGE: decomp(i); i ideal (for primary decomposition) (resp. 1883 1897 decomp(i,1); (for the minimal associated primes) ) 1884 1898 RETURN: list = list of primary ideals and their associated primes … … 1887 1901 NOTE: Algorithm of Gianni, Traeger, Zacharias 1888 1902 EXAMPLE: example decomp; shows an example 1903 " 1889 1904 { 1890 1905 def @P = basering; … … 2740 2755 /////////////////////////////////////////////////////////////////////////////// 2741 2756 proc radicalKL (list m,ideal ser,list #) 2742 USAGE: decomp(i); i ideal (for primary decomposition) (resp.2757 "USAGE: decomp(i); i ideal (for primary decomposition) (resp. 2743 2758 decomp(i,1); (for the minimal associated primes) ) 2744 2759 RETURN: list = list of primary ideals and their associated primes … … 2747 2762 NOTE: Algorithm of Gianni, Traeger, Zacharias 2748 2763 EXAMPLE: example decomp; shows an example 2764 " 2749 2765 { 2750 2766 ideal i=m[2]; -
Singular/LIB/primitiv.lib
r4996f52 rd2b2a7 1 // $Id: primitiv.lib,v 1. 4 1998-04-23 13:23:27 obachmanExp $1 // $Id: primitiv.lib,v 1.5 1998-05-05 11:55:35 krueger 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. 4 1998-04-23 13:23:27 obachmanExp $";5 version="$Id: primitiv.lib,v 1.5 1998-05-05 11:55:35 krueger Exp $"; 6 6 info=" 7 7 LIBRARY: primitiv.lib PROCEDURES FOR FINDING A PRIMITIVE ELEMENT … … 17 17 18 18 proc randomLast(int b) 19 USAGE: randomLast19 "USAGE: randomLast 20 20 RETURN: ideal = maxideal(1) but the last variable exchanged by 21 21 a sum of it with a linear random combination of the other 22 22 variables 23 23 EXAMPLE: example randomLast; shows an example 24 " 24 25 { 25 26 ideal i=maxideal(1); … … 40 41 41 42 proc primitive(ideal i) 42 USAGE: primitive(i); i ideal of the following form:43 "USAGE: primitive(i); i ideal of the following form: 43 44 Let k be the ground field of your basering, a_1,...,a_n algebraic over k, 44 45 m_1(x1), m_2(x_1,x_2),...,m_n(x_1,...,x_n) polynomials in k such that … … 54 55 of given algebraic elements (and minimal polynomials) 55 56 EXAMPLE: example primitive; shows an example 57 " 56 58 { 57 59 def altring=basering; … … 125 127 126 128 proc splitring 127 USAGE: splitring(f,R[,L]); f poly, univariate, irreducible(!), R string,129 "USAGE: splitring(f,R[,L]); f poly, univariate, irreducible(!), R string, 128 130 L list of polys and/or ideals (optional) 129 131 ACTION: defines a ring with name R, in which f is reducible, and changes to it … … 135 137 The names of variables and orderings are not affected. 136 138 137 It is also allowed to call splitring with R== "". Then the old basering139 It is also allowed to call splitring with R==\"\". Then the old basering 138 140 will be REPLACED by the new ring (with the same name as the old ring). 139 141 … … 142 144 (e.g. it cannot be a transcendent ring extension of Q or Z/p) 143 145 EXAMPLE: example splitring; shows an example 146 " 144 147 { 145 148 //----------------- split ist bereits eine proc in 'inout.lib' ! ------------- -
Singular/LIB/random.lib
r4996f52 rd2b2a7 1 // $Id: random.lib,v 1. 4 1998-04-03 22:47:12krueger Exp $1 // $Id: random.lib,v 1.5 1998-05-05 11:55:36 krueger Exp $ 2 2 //system("random",787422842); 3 3 //(GMG/BM, last modified 22.06.96) 4 4 /////////////////////////////////////////////////////////////////////////////// 5 5 6 version="$Id: random.lib,v 1. 4 1998-04-03 22:47:12krueger Exp $";6 version="$Id: random.lib,v 1.5 1998-05-05 11:55:36 krueger Exp $"; 7 7 info=" 8 8 LIBRARY: random.lib PROCEDURES OF RANDOM MATRIX AND POLY OPERATIONS … … 23 23 24 24 proc genericid (id, list #) 25 USAGE: genericid(id,[,p,b]); id ideal/module, k,p,b integers25 "USAGE: genericid(id,[,p,b]); id ideal/module, k,p,b integers 26 26 RETURN: system of generators of id which are generic, sparse, triagonal linear 27 27 combinations of given generators with coefficients in [1,b] and … … 29 29 NOTE: For performance reasons try small bound b in characteristic 0 30 30 EXAMPLE: example genericid; shows an example 31 " 31 32 { 32 33 //----------------------------- set defaults ---------------------------------- … … 50 51 51 52 proc randomid (id, list #) 52 USAGE: randomid(id,[k,b]); id ideal/module, b,k integers53 "USAGE: randomid(id,[k,b]); id ideal/module, b,k integers 53 54 RETURN: ideal/module having k generators which are random linear combinations 54 55 of generators of id with coefficients in the interval [-b,b] … … 56 57 NOTE: For performance reasons try small bound b in characteristic 0 57 58 EXAMPLE: example randomid; shows an example 59 " 58 60 { 59 61 //----------------------------- set defaults ---------------------------------- … … 76 78 77 79 proc randommat (int n, int m, list #) 78 USAGE: randommat(n,m[,id,b]); n,m,b integers, id ideal80 "USAGE: randommat(n,m[,id,b]); n,m,b integers, id ideal 79 81 RETURN: nxm matrix, entries are random linear combinations of elements 80 82 of id and coefficients in [-b,b] … … 82 84 NOTE: For performance reasons try small bound b in char 0 83 85 EXAMPLE: example randommat; shows an example 86 " 84 87 { 85 88 //----------------------------- set defaults ---------------------------------- … … 109 112 110 113 proc sparseid (int k, int u, list #) 111 USAGE: sparseid(k,u[,o,p,b]); k,u,o,p,b integers114 "USAGE: sparseid(k,u[,o,p,b]); k,u,o,p,b integers 112 115 RETURN: ideal having k generators in each degree d, u<=d<=o, p percent of 113 116 terms in degree d are 0, the remaining have random coefficients 114 117 in the interval [1,b], (default: o=u=d, p=75, b=30000) 115 118 EXAMPLE: example sparseid; shows an example 119 " 116 120 { 117 121 //----------------------------- set defaults ---------------------------------- … … 138 142 139 143 proc sparsemat (int n, int m, list #) 140 USAGE: sparsemat(n,m[,p,b]); n,m,p,b integers144 "USAGE: sparsemat(n,m[,p,b]); n,m,p,b integers 141 145 RETURN: nxm integer matrix, p percent of the entries are 0, the remaining 142 146 are random coefficients >=1 and <= b; [defaults: (p,b) = (75,1)] 143 147 EXAMPLE: example sparsemat; shows an example 148 " 144 149 { 145 150 int r,h,ii; … … 184 189 185 190 proc sparsepoly (int u, list #) 186 USAGE: sparsepoly(u[,o,p,b]); u,o,p,b integers191 "USAGE: sparsepoly(u[,o,p,b]); u,o,p,b integers 187 192 RETURN: poly having only terms in degree d, u<=d<=o, p percent of the terms 188 193 in degree d are 0, the remaining have random coefficients in [1,b), 189 194 (defaults: o=u=d, p=75, b=30000) 190 195 EXAMPLE: example sparsepoly; shows an example 196 " 191 197 { 192 198 //----------------------------- set defaults ---------------------------------- … … 209 215 210 216 proc sparsetriag (int n, int m, list #) 211 USAGE: sparsetriag(n,m[,p,b]); n,m,p,b integers217 "USAGE: sparsetriag(n,m[,p,b]); n,m,p,b integers 212 218 RETURN: nxm lower triagonal integer matrix, diagonal entries equal to 1, about 213 219 p percent of lower diagonal entries are 0, the remaining are random 214 220 integers >=1 and <= b; [defaults: (p,b) = (75,1)] 215 221 EXAMPLE: example sparsetriag; shows an example 222 " 216 223 { 217 224 int ii,min,l,r; intmat M[n][m]; -
Singular/LIB/ring.lib
r4996f52 rd2b2a7 1 // $Id: ring.lib,v 1. 5 1998-04-03 22:47:13krueger Exp $1 // $Id: ring.lib,v 1.6 1998-05-05 11:55:37 krueger Exp $ 2 2 //(GMG, last modified 03.11.95) 3 3 /////////////////////////////////////////////////////////////////////////////// 4 4 5 version="$Id: ring.lib,v 1. 5 1998-04-03 22:47:13krueger Exp $";5 version="$Id: ring.lib,v 1.6 1998-05-05 11:55:37 krueger Exp $"; 6 6 info=" 7 7 LIBRARY: ring.lib PROCEDURES FOR MANIPULATING RINGS AND MAPS … … 26 26 27 27 proc changechar (string newr, string c, list #) 28 USAGE: changechar(newr,c[,r]); newr,c=strings, r=ring28 "USAGE: changechar(newr,c[,r]); newr,c=strings, r=ring 29 29 CREATE: create a new ring with name `newr` and make it the basering if r is 30 30 an existing ring [default: r=basering]. 31 31 The new ring differs from the old ring only in the characteristic. 32 If, say, (newr,c) = ( "R","0,A") and the ring r exists, the new32 If, say, (newr,c) = (\"R\",\"0,A\") and the ring r exists, the new 33 33 basering will have name R characteristic 0 and one parameter A. 34 34 RETURN: No return value … … 38 38 start with @ (see the file HelpForProc) 39 39 EXAMPLE: example changechar; shows an example 40 " 40 41 { 41 42 if( size(#)==0 ) { def @r=basering; } … … 71 72 72 73 proc changeord (string newr, string o, list #) 73 USAGE: changeord(newr,o[,r]); newr,o=strings, r=ring/qring74 "USAGE: changeord(newr,o[,r]); newr,o=strings, r=ring/qring 74 75 CREATE: create a new ring with name `newr` and make it the basering if r is 75 76 an existing ring/qring [default: r=basering]. 76 77 The new ring differs from the old ring only in the ordering. If, say, 77 (newr,o) = ( "R","wp(2,3),dp") and the ring r exists and has >=378 (newr,o) = (\"R\",\"wp(2,3),dp\") and the ring r exists and has >=3 78 79 variables, the new basering will have name R and ordering wp(2,3),dp. 79 80 RETURN: No return value … … 82 83 start with @ (see the file HelpForProc) 83 84 EXAMPLE: example changeord; shows an example 85 " 84 86 { 85 87 if( size(#)==0 ) { def @r=basering; } … … 117 119 118 120 proc changevar (string newr, string vars, list #) 119 USAGE: changevar(newr,vars[,r]); newr,vars=strings, r=ring/qring121 "USAGE: changevar(newr,vars[,r]); newr,vars=strings, r=ring/qring 120 122 CREATE: creates a new ring with name `newr` and makes it the basering if r 121 123 is an existing ring/qring [default: r=basering]. 122 124 The new ring differs from the old ring only in the variables. If, 123 say, (newr,vars) = ( "R","t()") and the ring r exists and has n125 say, (newr,vars) = (\"R\",\"t()\") and the ring r exists and has n 124 126 variables, the new basering will have name R and variables 125 127 t(1),...,t(n). 126 If vars = "a,b,c,d", the new ring will have the variables a,b,c,d.128 If vars = \"a,b,c,d\", the new ring will have the variables a,b,c,d. 127 129 RETURN: No return value 128 130 NOTE: This procedure is useful in connection with the procedure ringtensor, … … 132 134 start with @ (see the file HelpForProc) 133 135 EXAMPLE: example changevar; shows an example 136 " 134 137 { 135 138 if( size(#)==0 ) { def @r=basering; } … … 174 177 175 178 proc defring (string s1, string s2, int n, string s3, string s4) 176 USAGE: defring(s1,s2,n,s3,s4); s1..s4=strings, n=integer179 "USAGE: defring(s1,s2,n,s3,s4); s1..s4=strings, n=integer 177 180 CREATE: Define a ring with name 's1', characteristic 's2', ordering 's4' and 178 181 n variables with names derived from s3 and make it the basering. 179 If s3 is a single letter, say s3= "a", and if n<=26 then a and the182 If s3 is a single letter, say s3=\"a\", and if n<=26 then a and the 180 183 following n-1 letters from the alphabeth (cyclic order) are taken as 181 184 variables. If n>26 or if s3 is a single letter followed by (, say 182 s3= "T(", the variables are T(1),...,T(n).185 s3=\"T(\", the variables are T(1),...,T(n). 183 186 RETURN: No return value 184 187 NOTE: This proc is useful for defining a ring in a procedure. … … 187 190 start with @ (see the file HelpForProc) 188 191 EXAMPLE: example defring; shows an example 192 " 189 193 { 190 194 string @newring = "ring "+s1+"=("+s2+"),("; … … 207 211 208 212 proc defrings (int n, list #) 209 USAGE: defrings(n,[p]); n,p integers213 "USAGE: defrings(n,[p]); n,p integers 210 214 CREATE: Defines a ring with name Sn, characteristic p, ordering ds and n 211 215 variables x,y,z,a,b,...if n<=26 (resp. x(1..n) if n>26) and makes it … … 213 217 RETURN: No return value 214 218 EXAMPLE: example defrings; shows an example 219 " 215 220 { 216 221 int p; … … 239 244 240 245 proc defringp (int n,list #) 241 USAGE: defringp(n,[p]); n,p=integers246 "USAGE: defringp(n,[p]); n,p=integers 242 247 CREATE: defines a ring with name Pn, characteristic p, ordering dp and n 243 248 variables x,y,z,a,b,...if n<=26 (resp. x(1..n) if n>26) and makes it … … 245 250 RETURN: No return value 246 251 EXAMPLE: example defringp; shows an example 252 " 247 253 { 248 254 int p; … … 272 278 273 279 proc extendring (string na, int n, string va, string o, list #) 274 USAGE: extendring(na,n,va,o[iv,i,r]); na,va,o=strings,280 "USAGE: extendring(na,n,va,o[iv,i,r]); na,va,o=strings, 275 281 n,i=integers, r=ring, iv=intvec of positive integers or iv=0 276 282 CREATE: Define a ring with name `na` which extends the ring r by adding n new … … 279 285 -- The characteristic is the characteristic of r 280 286 -- The new vars are derived from va. If va is a single letter, say 281 va= "T", and if n<=26 then T and the following n-1 letters from287 va=\"T\", and if n<=26 then T and the following n-1 letters from 282 288 T..Z..T (resp. T(1..n) if n>26) are taken as additional variables. 283 If va is a single letter followed by (, say va= "x(", the new289 If va is a single letter followed by (, say va=\"x(\", the new 284 290 variables are x(1),...,x(n) 285 291 -- The ordering is the product ordering between the ordering of r and … … 289 295 not contain a 'c' or a 'C' the same rule applies to ordstr(r). 290 296 - If no intvec iv is given, or if iv=0, o may be any allowed ordstr, 291 like "ds" or "dp(2),wp(1,2,3),Ds(2)" or "ds(a),dp(b),ls" if a and b297 like \"ds\" or \"dp(2),wp(1,2,3),Ds(2)\" or \"ds(a),dp(b),ls\" if a and b 292 298 are globally (!) defined integers and if a+b+1<=n 293 299 If, however, a and b are local to a proc calling extendring, the 294 300 intvec iv must be used to let extendring know the values of a and b 295 301 - If an intvec iv !=0 is given, iv[1],iv[2],... is taken for the 1st, 296 2nd,... block of o, if o contains no substring "w" or "W" i.e. no297 weighted ordering (in the above case o= "ds,dp,ls" and iv=a,b).302 2nd,... block of o, if o contains no substring \"w\" or \"W\" i.e. no 303 weighted ordering (in the above case o=\"ds,dp,ls\" and iv=a,b). 298 304 If o contains a weighted ordering (only one (!) weighted block is 299 305 allowed) iv[1] is taken as size for the weight-vector, the next 300 306 iv[1] values of iv are taken as weights and the remaining values of 301 307 iv as block-size for the remaining non-weighted blocks. 302 e.g. o= "dp,ws,Dp,ds", iv=3,2,3,4,2,5 creates the ordering308 e.g. o=\"dp,ws,Dp,ds\", iv=3,2,3,4,2,5 creates the ordering 303 309 dp(2),ws(2,3,4),Dp(5),ds 304 310 RETURN: No return value … … 308 314 start with @ (see the file HelpForProc) 309 315 EXAMPLE: example extendring; shows an example 316 " 310 317 { 311 318 //--------------- initialization and place c/C of ordering properly ----------- … … 425 432 426 433 proc fetchall (R, list #) 427 USAGE: fetchall(R[,s]); R=ring/qring, s=string434 "USAGE: fetchall(R[,s]); R=ring/qring, s=string 428 435 CREATE: fetch all objects of ring R (of type poly/ideal/vector/module/number/ 429 436 matrix) into the basering. 430 437 If no 3rd argument is present, the names are the same as in R. If, 431 say, f is a poly in R and the 3rd argument is the string "R", then f438 say, f is a poly in R and the 3rd argument is the string \"R\", then f 432 439 is maped to f_R etc. 433 440 RETURN: no return value … … 439 446 //***at the moment it does not work if R contains a map 440 447 EXAMPLE: example fetchall; shows an example 448 " 441 449 { 442 450 list @L@=names(R); … … 469 477 470 478 proc imapall (R, list #) 471 USAGE: imapall(R[,s]); R=ring/qring, s=string479 "USAGE: imapall(R[,s]); R=ring/qring, s=string 472 480 CREATE: map all objects of ring R (of type poly/ideal/vector/module/number/ 473 481 matrix) into the basering, by applying imap to all objects of R. 474 482 If no 3rd argument is present, the names are the same as in R. If, 475 say, f is a poly in R and the 3rd argument is the string "R", then f483 say, f is a poly in R and the 3rd argument is the string \"R\", then f 476 484 is maped to f_R etc. 477 485 RETURN: no return value … … 483 491 //***at the moment it does not work if R contains a map 484 492 EXAMPLE: example imapall; shows an example 493 " 485 494 { 486 495 list @L@=names(R); … … 513 522 514 523 proc mapall (R, ideal i, list #) 515 USAGE: mapall(R,i[,s]); R=ring/qring, i=ideal of basering, s=string524 "USAGE: mapall(R,i[,s]); R=ring/qring, i=ideal of basering, s=string 516 525 CREATE: map all objects of ring R (of type poly/ideal/vector/module/number/ 517 526 matrix, map) into the basering, by mapping the jth variable of R to 518 527 the jth generator of the ideal i. If no 3rd argument is present, the 519 528 names are the same as in R. If, say, f is a poly in R and the 3rd 520 argument is the string "R", then f is maped to f_R etc.529 argument is the string \"R\", then f is maped to f_R etc. 521 530 RETURN: no return value 522 531 NOTE: This procedure has the same effect as defining a map, say psi, by … … 529 538 CAUTION: mapall does not work inside a procedure 530 539 EXAMPLE: example mapall; shows an example 540 " 531 541 { 532 542 list @L@=names(R); map @psi@ = R,i; … … 566 576 567 577 proc ringtensor (string s, list #) 568 USAGE: ringtensor(s,r1,r2,...); s=string, r1,r2,...=rings578 "USAGE: ringtensor(s,r1,r2,...); s=string, r1,r2,...=rings 569 579 CREATE: A new base ring with name `s` if r1,r2,... are existing rings. 570 If, say, s = "R" and the rings r1,r2,... exist, the new ring will580 If, say, s = \"R\" and the rings r1,r2,... exist, the new ring will 571 581 have name R, variables from all rings r1,r2,... and as monomial 572 582 ordering the block (product) ordering of r1,r2,... . Hence, R … … 585 595 start with @ (see the file HelpForProc) 586 596 EXAMPLE: example ringtensor; shows an example 597 " 587 598 { 588 599 int @ii,@q; -
Singular/LIB/sing.lib
r4996f52 rd2b2a7 1 // $Id: sing.lib,v 1. 9 1998-04-03 22:47:13krueger Exp $1 // $Id: sing.lib,v 1.10 1998-05-05 11:55:38 krueger Exp $ 2 2 //system("random",787422842); 3 3 //(GMG/BM, last modified 26.06.96) 4 4 /////////////////////////////////////////////////////////////////////////////// 5 5 6 version="$Id: sing.lib,v 1. 9 1998-04-03 22:47:13krueger Exp $";6 version="$Id: sing.lib,v 1.10 1998-05-05 11:55:38 krueger Exp $"; 7 7 info=" 8 8 LIBRARY: sing.lib PROCEDURES FOR SINGULARITIES … … 32 32 33 33 proc deform (ideal id) 34 USAGE: deform(id); id=ideal or poly34 "USAGE: deform(id); id=ideal or poly 35 35 RETURN: matrix, columns are kbase of infinitesimal deformations 36 36 EXAMPLE: example deform; shows an example 37 " 37 38 { 38 39 list L=T1(id,""); … … 51 52 52 53 proc dim_slocus (ideal i) 53 USAGE: dim_slocus(i); i ideal or poly54 "USAGE: dim_slocus(i); i ideal or poly 54 55 RETURN: dimension of singular locus of i 55 56 EXAMPLE: example dim_slocus; shows an example 57 " 56 58 { 57 59 return(dim(std(slocus(i)))); … … 66 68 67 69 proc is_active (poly f, id) 68 USAGE: is_active(f,id); f poly, id ideal or module70 "USAGE: is_active(f,id); f poly, id ideal or module 69 71 RETURN: 1 if f is an active element modulo id (i.e. dim(id)=dim(id+f*R^n)+1, 70 72 if id is a submodule of R^n) resp. 0 if f is not active. … … 73 75 components). proc is_reg tests whether f is a regular parameter 74 76 EXAMPLE: example is_active; shows an example 77 " 75 78 { 76 79 if( size(id)==0 ) { return(1); } … … 93 96 94 97 proc is_ci (ideal i) 95 USAGE: is_ci(i); i ideal98 "USAGE: is_ci(i); i ideal 96 99 RETURN: intvec = sequence of dimensions of ideals (j[1],...,j[k]), for 97 100 k=1,...,size(j), where j is minimal base of i. i is a complete … … 101 104 printlevel >=0: display comments (default) 102 105 EXAMPLE: example is_ci; shows an example 106 " 103 107 { 104 108 int n; intvec dimvec; ideal id; … … 135 139 136 140 proc is_is (ideal i) 137 USAGE: is_is(id); id ideal or poly141 "USAGE: is_is(id); id ideal or poly 138 142 RETURN: intvec = sequence of dimensions of singular loci of ideals 139 143 generated by id[1]..id[i], k = 1..size(id); dim(0-ideal) = -1; … … 141 145 NOTE: printlevel >=0: display comments (default) 142 146 EXAMPLE: example is_is; shows an example 147 " 143 148 { 144 149 int l; intvec dims; ideal j; … … 168 173 169 174 proc is_reg (poly f, id) 170 USAGE: is_reg(f,id); f poly, id ideal or module175 "USAGE: is_reg(f,id); f poly, id ideal or module 171 176 RETURN: 1 if multiplication with f is injective modulo id, 0 otherwise 172 177 NOTE: let R be the basering and id a submodule of R^n. The procedure checks … … 174 179 //**quotient ring 175 180 EXAMPLE: example is_reg; shows an example 181 " 176 182 { 177 183 if( f==0 ) { return(0); } … … 199 205 200 206 proc is_regs (ideal i, list #) 201 USAGE: is_regs(i[,id]); i poly, id ideal or module (default: id=0)207 "USAGE: is_regs(i[,id]); i poly, id ideal or module (default: id=0) 202 208 RETURN: 1 if generators of i are a regular sequence modulo id, 0 otherwise 203 209 NOTE: let R be the basering and id a submodule of R^n. The procedure checks … … 207 213 printlevel >=1: display comments during computation 208 214 EXAMPLE: example is_regs; shows an example 215 " 209 216 { 210 217 int d,ii,r; … … 246 253 247 254 proc milnor (ideal i) 248 USAGE: milnor(i); i ideal or poly255 "USAGE: milnor(i); i ideal or poly 249 256 RETURN: Milnor number of i, if i is ICIS (isolated complete intersection 250 257 singularity) in generic form, resp. -1 if not … … 252 259 printlevel >=0: display comments (default) 253 260 EXAMPLE: example milnor; shows an example 261 " 254 262 { 255 263 i = simplify(i,10); //delete zeroes and multiples from set of generators … … 298 306 299 307 proc nf_icis (ideal i) 300 USAGE: nf_icis(i); i ideal308 "USAGE: nf_icis(i); i ideal 301 309 RETURN: ideal = generic linear combination of generators of i if i is an ICIS 302 310 (isolated complete intersection singularity), return i if not … … 304 312 printlevel >=0: display comments (default) 305 313 EXAMPLE: example nf_icis; shows an example 314 " 306 315 { 307 316 i = simplify(i,10); //delete zeroes and multiples from set of generators … … 349 358 350 359 proc slocus (ideal i) 351 USAGE: slocus(i); i dieal360 "USAGE: slocus(i); i dieal 352 361 RETURN: ideal of singular locus of i 353 362 NOTE: this proc considers lower dimensional components as singular 354 363 EXAMPLE: example slocus; shows an example 364 " 355 365 { 356 366 int cod = nvars(basering)-dim(std(i)); … … 367 377 368 378 proc spectrum (poly f, intvec w) 369 USAGE: spectrum(f,w); f=poly, w=intvec;379 "USAGE: spectrum(f,w); f=poly, w=intvec; 370 380 ASSUME: f is a weighted homogeneous isolated singularity w.r.t. the weights 371 381 given by w; w must consist of as many positive integers as there … … 378 388 singularity, displays a warning in this case 379 389 EXAMPLE: example spectrum; shows an example 390 " 380 391 { 381 392 int i,d,W; … … 419 430 420 431 proc Tjurina (id, list #) 421 USAGE: Tjurina(id[,<any>]); id=ideal or poly432 "USAGE: Tjurina(id[,<any>]); id=ideal or poly 422 433 ASSUME: id=ICIS (isolated complete intersection singularity) 423 434 RETURN: standard basis of Tjurina-module of id, … … 431 442 NOTE: Tjurina number = -1 implies that id is not an ICIS 432 443 EXAMPLE: example Tjurina; shows examples 444 " 433 445 { 434 446 //---------------------------- initialisation --------------------------------- … … 468 480 469 481 proc tjurina (ideal i) 470 USAGE: tjurina(id); id=ideal or poly482 "USAGE: tjurina(id); id=ideal or poly 471 483 ASSUME: id=ICIS (isolated complete intersection singularity) 472 484 RETURN: int = Tjurina number of id 473 485 NOTE: Tjurina number = -1 implies that id is not an ICIS 474 486 EXAMPLE: example tjurina; shows an example 487 " 475 488 { 476 489 return(vdim(Tjurina(i))); … … 485 498 486 499 proc T1 (ideal id, list #) 487 USAGE: T1(id[,<any>]); id = ideal or poly500 "USAGE: T1(id[,<any>]); id = ideal or poly 488 501 RETURN: T1(id): of type module/ideal if id is of type ideal/poly. 489 502 We call T1(id) the T1-module of id. It is a std basis of the … … 507 520 For a complete intersection the proc Tjurina is faster 508 521 EXAMPLE: example T1; shows an example 522 " 509 523 { 510 524 ideal J=simplify(id,10); … … 570 584 571 585 proc T2 (ideal id, list #) 572 USAGE: T2(id[,<any>]); id = ideal586 "USAGE: T2(id[,<any>]); id = ideal 573 587 RETURN: T2(id): T2-module of id . This is a std basis of a presentation of 574 588 the module of obstructions of R=P/id, if P is the basering. … … 586 600 Use proc miniversal to get equations of miniversal deformation. 587 601 EXAMPLE: example T2; shows an example 602 " 588 603 { 589 604 //--------------------------- initialisation ---------------------------------- … … 638 653 639 654 proc T12 (ideal i, list #) 640 USAGE: T12(i[,any]); i = ideal655 "USAGE: T12(i[,any]); i = ideal 641 656 RETURN: T12(i): list of 2 modules: 642 657 std basis of T1-module =T1(i), 1st order deformations … … 657 672 the list contains all objects used by proc miniversal 658 673 EXAMPLE: example T12; shows an example 674 " 659 675 { 660 676 //--------------------------- initialisation ---------------------------------- … … 724 740 /////////////////////////////////////////////////////////////////////////////// 725 741 proc codim (id1, id2) 726 USAGE: codim(id1,id2); id1,id2 ideal or module, both must be standard bases742 "USAGE: codim(id1,id2); id1,id2 ideal or module, both must be standard bases 727 743 RETURN: int, which is: 728 744 1. the codimension of id2 in id1, i.e. the vectorspace dimension of … … 734 750 sum of the coefficients of q(t) (n dimension of basering) 735 751 EXAMPLE: example codim; shows an example 752 " 736 753 { 737 754 intvec iv1, iv2, iv; -
Singular/LIB/standard.lib
r4996f52 rd2b2a7 1 // $Id: standard.lib,v 1. 7 1998-04-03 22:47:14krueger Exp $1 // $Id: standard.lib,v 1.8 1998-05-05 11:55:38 krueger Exp $ 2 2 /////////////////////////////////////////////////////////////////////////////// 3 3 4 version="$Id: standard.lib,v 1. 7 1998-04-03 22:47:14krueger Exp $";4 version="$Id: standard.lib,v 1.8 1998-05-05 11:55:38 krueger Exp $"; 5 5 info=" 6 6 LIBRARY: standard.lib PROCEDURES WHICH ARE ALWAYS LOADED AT START-UP … … 13 13 14 14 proc stdfglm (ideal i, list #) 15 USAGE: stdfglm(i[,s]); i ideal, s string (any allowed ordstr of a ring)15 "USAGE: stdfglm(i[,s]); i ideal, s string (any allowed ordstr of a ring) 16 16 RETURN: stdfglm(i): standard basis of i in the basering, calculated via fglm 17 from ordering "dp" to the ordering of the basering.17 from ordering \"dp\" to the ordering of the basering. 18 18 stdfglm(i,s): standard basis of i in the basering, calculated via 19 19 fglm from ordering s to the ordering of the basering. 20 20 EXAMPLE: example stdfglm; shows an example 21 " 21 22 { 22 23 string os; … … 56 57 57 58 proc stdhilbert(ideal i,list #) 58 USAGE: stdhilbert(i); i ideal59 "USAGE: stdhilbert(i); i ideal 59 60 stdhilbert(i,v); i homogeneous ideal, v intvec (the Hilbert function) 60 61 RETURN: stdhilbert(i): a standard basis of i (computing v internally) 61 62 stdhilbert(i,v): standard basis of i, using the given Hilbert function 62 63 EXAMPLE: example stdhilbert; shows an example 64 " 63 65 { 64 66 def R=basering; -
Singular/LIB/tex.lib
r4996f52 rd2b2a7 1 // $Id: tex.lib,v 1. 5 1998-04-03 22:47:15krueger Exp $1 // $Id: tex.lib,v 1.6 1998-05-05 11:55:39 krueger Exp $ 2 2 // 3 3 // author : Christian Gorzel email: gorzelc@math.uni-muenster.de … … 5 5 /////////////////////////////////////////////////////////////////////////////// 6 6 7 version="$Id: tex.lib,v 1. 5 1998-04-03 22:47:15krueger Exp $";7 version="$Id: tex.lib,v 1.6 1998-05-05 11:55:39 krueger Exp $"; 8 8 info=" 9 9 LIBRARY: tex.lib PROCEDURES FOR TYPESET OF SINGULAROBJECTS IN TEX … … 45 45 46 46 proc closetex(string fname, list #) 47 USAGE: closetex(fname[,style]); fname,style = string47 "USAGE: closetex(fname[,style]); fname,style = string 48 48 RETURN: nothing; writes a LaTeX2e closing line into file fname 49 49 NOTE: style overwrites the default setting latex2e; maybe latex,amstex,tex 50 preceeding ">>" end ending ".tex" may miss in fname;50 preceeding \">>\" end ending \".tex\" may miss in fname; 51 51 overwriting an existing file is not possible 52 52 EXAMPLE: example closetex; shows an example 53 " 53 54 { 54 55 string default = "latex2e"; // may be changed appropriatly (C.G.) … … 81 82 82 83 proc tex(string fname, list #) 83 USAGE: tex(fname[,style]); fname,style = string84 "USAGE: tex(fname[,style]); fname,style = string 84 85 RETURN: nothing; calls latex2e for compiling the file fname 85 86 NOTE: style overwrites the default setting latex2e; maybe latex,amstex,tex 86 ending ".tex" may miss in fname87 ending \".tex\" may miss in fname 87 88 EXAMPLE: example tex; shows an example 89 " 88 90 { 89 91 string default = "latex2e"; // may be changed appropriatly (C.G.) … … 125 127 126 128 proc opentex(string fname, list #) 127 USAGE: opentex(fname[,style]); fname,style = string129 "USAGE: opentex(fname[,style]); fname,style = string 128 130 RETURN: nothing; writes as LaTeX2e header into a new file fname 129 131 NOTE: suffix .tex may miss in fname 130 132 style overwrites the default setting latex2e; may be latex,amstex,tex 131 133 EXAMPLE: example opentex; shows an example 134 " 132 135 { 133 136 int i =1; … … 166 169 167 170 proc texdemo(list #) 168 USAGE: texdemo();171 "USAGE: texdemo(); 169 172 RETURN: nothing; generates automatically a LaTeX2e file called: texlibdemo.tex 170 173 explaining the features of tex.lib and its gloabl variables 171 174 NOTE: this proc takes some minutes 172 175 EXAMPLE: example texdemo; executes the generation 176 " 173 177 { int make_demo = size(#); 174 178 … … 200 204 201 205 proc texfactorize(string fname, poly f, list #) 202 USAGE: opentex(fname,f); fname = string; f = poly206 "USAGE: opentex(fname,f); fname = string; f = poly 203 207 RETURN: string, the poly as as product of its irreducible factors 204 208 in TeX-typesetting if fname == empty string; 205 209 otherwise append this to file fname.tex; return nothing 206 NOTE: preceeding ">>" end ending ".tex" may miss in fname210 NOTE: preceeding \">>\" end ending \".tex\" may miss in fname 207 211 EXAMPLE: example texfactorize; shows an example 212 " 208 213 { 209 214 def @r = basering; … … 272 277 273 278 proc texmap(string fname, def m, def @r1, def @r2, list #) 274 USAGE: texmap(fname,f); fname = string; m = string/map, @r1,@r2 = ring279 "USAGE: texmap(fname,f); fname = string; m = string/map, @r1,@r2 = ring 275 280 RETURN: string, the map m from @r1 to @r2 preeceded by its name if m = string 276 281 in TeX-typesetting if fname == empty string; 277 282 otherwise append this to file fname.tex; return nothing 278 NOTE: preceeding ">>" end ending ".tex" may miss in fname283 NOTE: preceeding \">>\" end ending \".tex\" may miss in fname 279 284 EXAMPLE: example texmap; shows an example 285 " 280 286 { 281 287 int saveDollars= defined(NoDollars); … … 419 425 420 426 proc texname(string fname, string s) 421 USAGE: texname(fname,s); fname,s = string422 RETURN: the string s if fname == the empty string "" ;427 "USAGE: texname(fname,s); fname,s = string 428 RETURN: the string s if fname == the empty string \"\" ; 423 429 otherwise append s to file fname.tex; return nothing 424 NOTE: preceeding ">>" end ending ".tex" may miss in fname;430 NOTE: preceeding \">>\" end ending \".tex\" may miss in fname; 425 431 EXAMPLE: example texname; shows an example 432 " 426 433 { 427 434 string st, extr; … … 495 502 496 503 proc texobj(string fname, list #) 497 USAGE: texobj(fname,l); fname = string,l = list of Singular dataypes504 "USAGE: texobj(fname,l); fname = string,l = list of Singular dataypes 498 505 RETURN: string, the objects in TeX-typesetting if fname == empty string; 499 506 otherwise append this to file fname.tex; return nothing 500 NOTE: preceeding ">>" end ending ".tex" may miss in fname;507 NOTE: preceeding \">>\" end ending \".tex\" may miss in fname; 501 508 EXAMPLE: example texobj; shows an example 509 " 502 510 { 503 511 int i,j,k,nr,nc,linear,Tw,Dollars; … … 759 767 760 768 proc texproc(string fname,string pname) 761 USAGE: opentex(fname,pname); fname,pname = string769 "USAGE: opentex(fname,pname); fname,pname = string 762 770 RETURN: string, the proc in a verbatim environment in TeX-typesetting 763 771 if fname == empty string; 764 772 otherwise append this to file fname.tex; return nothing 765 NOTE: preceeding ">>" end ending ".tex" may miss in fname;773 NOTE: preceeding \">>\" end ending \".tex\" may miss in fname; 766 774 CAUTION: texproc cannot applied on itself correctly 767 775 EXAMPLE: example texproc; shows an example 776 " 768 777 { 769 778 int i,j=1,1; … … 825 834 826 835 proc texring(string fname, def r, list #) 827 USAGE: texring(fname, r[,l]); fname = string; r = ring;836 "USAGE: texring(fname, r[,l]); fname = string; r = ring; 828 837 l=list of strings : controls the symbol for 829 838 coefficint field etc. see example texdemo(); 830 839 RETURN: string, the ring in TeX-typesetting if fname == empty string; 831 840 otherwise append this to file fname.tex; return nothing 832 NOTE: preceeding ">>" end ending ".tex" may miss in fname;841 NOTE: preceeding \">>\" end ending \".tex\" may miss in fname; 833 842 EXAMPLE: example texring; shows an example 843 " 834 844 { 835 845 int i,galT,flag,mipo,nopar,Dollars,TB,TA; … … 1010 1020 1011 1021 proc rmx(string fname) 1012 USAGE: rmx(fname); fname = string1022 "USAGE: rmx(fname); fname = string 1013 1023 RETURN: nothing; removes .log and .aux files associated to file <fname> 1014 removes tex and xdvi file too, if suffix ".tex" or ".dvi" is given1024 removes tex and xdvi file too, if suffix \".tex\" or \".dvi\" is given 1015 1025 NOTE: if fname ends by .dvi or .tex 1016 1026 fname.dvi or fname.dvi and fname.tex will be deleted, too 1017 1027 EXAMPLE: example rmx; shows an example 1028 " 1018 1029 { 1019 1030 int i,suffix= 1,0; … … 1058 1069 1059 1070 proc xdvi(string fname, list #) 1060 USAGE: xdvi(fname[,style]); fname,style = string1071 "USAGE: xdvi(fname[,style]); fname,style = string 1061 1072 RETURN: nothing; displays dvi-file fname.dvi with previewer xdvi 1062 1073 NOTE: ending .dvi may miss in fname 1063 1074 style overwrites the default setting xdvi 1064 1075 EXAMPLE: example xdvi ; shows an example 1076 " 1065 1077 { 1066 1078 int i=1; … … 1331 1343 } 1332 1344 1333 proc parst(string s,int sec) // parse parameter1345 proc parst(string s,int sec)" // parse parameter 1334 1346 // sec parameter to see if in parsp a fraction follows 1347 " 1335 1348 { int i,j =1,-1; 1336 1349 int b,k,jj,mz; // begin and end -
Singular/LIB/tst.lib
r4996f52 rd2b2a7 1 // $Id: tst.lib,v 1. 3 1998-04-03 22:47:15krueger Exp $1 // $Id: tst.lib,v 1.4 1998-05-05 11:55:40 krueger Exp $ 2 2 //(obachman, last modified 2/13/98) 3 3 /////////////////////////////////////////////////////////////////////////////// 4 4 5 version="$Id: tst.lib,v 1. 3 1998-04-03 22:47:15krueger Exp $";5 version="$Id: tst.lib,v 1.4 1998-05-05 11:55:40 krueger Exp $"; 6 6 info=" 7 7 LIBRARY: tst.lib PROCEDURES FOR RUNNING AUTOMATIC TST TESTS … … 17 17 18 18 proc tst_system(string s) 19 USAGE: tst_system(s); s string20 RETURN: string which is stdout and stderr of system("sh", s)19 "USAGE: tst_system(s); s string 20 RETURN: string which is stdout \x and stderr of system(\"sh\", s) 21 21 EXAMPLE: example tst_system; shows examples 22 " 22 23 { 23 24 string tmpfile = "/tmp/tst_" + string(system("pid")); … … 39 40 40 41 proc tst_ignore 41 USAGE: tst_ignore(any,[keyword], [link])42 "USAGE: tst_ignore(any,[keyword], [link]) 42 43 any -- valid argument to string() 43 keyword -- one of "time" or "memory"44 keyword -- one of \"time\" or \"memory\" 44 45 link -- a link which can be written to 45 46 RETURN: none; writes string(any) to link (or stdout, if no link given), 46 prepending prefix "// ignore:", or "// ignore: time:",47 "//ignore: memory:" if called with the respective keywords;47 prepending prefix \"// ignore:\", or \"// ignore: time:\", 48 \"//ignore: memory:\" if called with the respective keywords; 48 49 should be used in tst files to output system dependent data 49 (like date, pathnames) and timings With the keyword "time",50 resp. memory us gae with the keyword "memory"50 (like date, pathnames) { and timings With the keyword \"time\", 51 resp. memory usage with the keyword \"memory\" 51 52 EXAMPLE: example tst_ignore; shows examples 53 " 52 54 { 53 55 string s; … … 130 132 131 133 proc tst_init 132 USAGE: tst_init()134 "USAGE: tst_init() 133 135 RETURN: none; writes some identification data to stdout; 134 136 should be called as first routine in a tst file 135 137 EXAMPLE: example tst_init; shows example 138 " 136 139 { 137 140 tst_ignore("USER : " + system("getenv", "USER")); -
Singular/libparse.l
r4996f52 rd2b2a7 3 3 * Computer Algebra System SINGULAR * 4 4 ****************************************/ 5 /* $Id: libparse.l,v 1.1 6 1998-04-29 11:25:19krueger Exp $ */5 /* $Id: libparse.l,v 1.17 1998-05-05 11:55:17 krueger Exp $ */ 6 6 #include <stdio.h> 7 7 #include <string.h> … … 10 10 #ifdef STANDALONE_PARSER 11 11 # include "utils.h" 12 # include <getopt.h> 12 13 # define HAVE_LIBPARSER 13 //# define YYLPDEBUG 3 14 # define YYLPDEBUG 1 14 15 #else 15 16 # include "mod2.h" … … 50 51 char *yylp_buffer_start; 51 52 int yylplineno = 1; 53 int lpverbose = 0, check = 0; 54 int found_info=0, 55 found_version=0, 56 found_oldhelp = 0, 57 found_proc_in_proc = 0; 52 58 53 59 char *yylp_errlist[]= { … … 112 118 int yylpwrap(); 113 119 } 120 void main_init(int argc, char *argv[]); 121 void main_result(char *libname); 114 122 # else /* STANDALONE_PARSER */ 115 123 idhdl h0; … … 180 188 letter [@a-zA-Z\'] 181 189 name ({letter}({letter}*{digit}*_*)*|_) 190 varname ({letter}({letter}*{digit}*_*\(\))*|_|#) 182 191 letters ({letter}|{digit}|[_./#%^*:,]) 183 192 string ({letters}*) 184 193 comment [\/][\/] 185 194 dolar [$] 186 symbols [~!@#$%^&*()_+-={}\\\|\[\];:,<.>/\?\' \n\~\`\r] 187 aletters ({letter}|{digit}|{symbols}|{dolar}|{escquote}) 195 nls [\n\r] 196 symbols [~!@#$%^&*()_+-=\\\|\[\];:,<.>/\?\' \t\~\`] 197 asymbols ({symbols}|[{}]) 198 bsymbols ({symbols}|{escbrack}|[}]) 199 aletters ({letter}|{digit}|{asymbols}|{dolar}|{escquote}|{nls}) 200 bletters ({letter}|{digit}|{bsymbols}|{dolar}|{quote}|{nls}) 201 cletters ({letter}|{digit}|{asymbols}|{dolar}|{quote}) 188 202 strings ({aletters}*) 203 escstrings ({bletters}*) 204 fstring ({cletters}*) 205 param ({name}+{tos}+{varname}) 206 parameters ({param}(,{param})*) 207 paramlist ("("{parameters}")") 189 208 quote [\"] 190 209 escquote (\\\") 191 taborspace [ \t] 192 tos ({taborspace}*) 193 eq (=|{tos}+=|=+{tos}|{tos}+=+{tos}) 210 escbrack (\\\{) 211 tnl ([ \t\n]*) 212 eos ({quote}+{tnl}+"{") 213 tos ([ \t]*) 214 eq ([ \t]*+=[ \t]*) 194 215 195 216 /* %start START */ … … 200 221 %x pdef 201 222 %x phead 223 %x poldhelp 224 %x phelp 202 225 %x pbody 203 226 %x pstr … … 212 235 213 236 info=+"\"" { old_state = YYSTATE; quote++; BEGIN(string); 237 found_info++; 214 238 string_start = current_pos(yyleng); 215 239 *lib_style = NEW_LIBSTYLE; … … 218 242 219 243 (version+{eq}+{quote}+{strings}+{quote}) { 244 found_version++; 220 245 if ( mode != GET_INFO ) { 221 246 make_version(yytext,1); … … 234 259 char proc[256]; 235 260 BEGIN(pdef); 236 #if YYLPDEBUG > 0 261 found_proc_in_proc = 0; 262 #if YYLPDEBUG > 1 237 263 printf("Newlib:%s\n", newlib); 238 264 #endif … … 261 287 SET_DEF_END(mode, pi, current_pos(yyleng+1)); 262 288 #if YYLPDEBUG 263 printf("PROC %d at %d/%d: (%d) %s\n", p_static,289 if(lpverbose>1) printf("PROC %d at %d/%d: (%d) %s\n", p_static, 264 290 yylplineno, current_pos(0), brace1, yytext); 265 291 #endif … … 273 299 SET_EXAMPLE_START(mode, pi, yylplineno, current_pos(0)); 274 300 #if YYLPDEBUG 275 printf("EXAMPLE at %d/%d (%d)\n", yylplineno,301 if(lpverbose>1) printf("EXAMPLE at %d/%d (%d)\n", yylplineno, 276 302 current_pos(0), brace1); 277 303 #endif … … 290 316 } 291 317 <header>(^{comment}+[^\n]*) { 292 #if YYLPDEBUG > 1318 #if YYLPDEBUG 293 319 printf("+(cmt)HEAD:%s\n", yytext); 294 320 #endif … … 321 347 #endif 322 348 //print_version(mode, libfile); 349 yyless(0); 323 350 BEGIN(help); 324 351 } … … 351 378 352 379 <help>\n { yylplineno++; } 380 <help>({tos}|{comment}+{fstring}) { 381 #if YYLPDEBUG 382 if(lpverbose>2) printf("--->%s<---\n", yytext); 383 #endif 384 } 353 385 <help>. { 386 found_oldhelp=1; 354 387 #if YYLPDEBUG > 1 355 388 printf("-HELP:%s\n", yytext); … … 366 399 #endif /* STANDALONE_PARSER */ 367 400 #if YYLPDEBUG 368 printf("LIB:'%s'\n", yytext);401 if(lpverbose>1) printf("LIB:'%s'\n", yytext); 369 402 #endif 370 403 BEGIN(INITIAL); … … 374 407 <pdef>\( { 375 408 brace2++; 376 #if YYLPDEBUG 409 #if YYLPDEBUG > 1 377 410 printf("%s", yytext); 378 411 #endif … … 380 413 <pdef>\) { 381 414 brace2--; 382 #if YYLPDEBUG 415 #if YYLPDEBUG > 1 383 416 printf(">%s<\n", yytext); 384 417 printf("{=%d, (=%d, [=%d\n", brace1, brace2, brace3); 385 418 #endif 386 419 if(brace2<=0) { 387 #if YYLPDEBUG 420 #if YYLPDEBUG > 1 388 421 printf("BEGIN(phead){=%d, (=%d, [=%d\n", brace1, brace2, brace3); 389 422 #endif 390 423 SET_DEF_END(mode, pi, current_pos(yyleng)); 391 SET_HELP_START(mode, pi, current_pos(yyleng));392 424 BEGIN(phead); 393 425 } … … 395 427 <pdef>"{" { 396 428 if(brace2>0) { 397 #if YYLPDEBUG 429 #if YYLPDEBUG > 1 398 430 printf("{=%d, (=%d, [=%d\n", brace1, brace2, brace3); 399 431 #endif … … 407 439 <pdef>\n { yylplineno++; 408 440 if(brace2<=0) { 409 #if YYLPDEBUG 441 #if YYLPDEBUG > 1 410 442 printf("BEGIN(phead-2){=%d, (=%d, [=%d\n", brace1, brace2, brace3); 411 443 #endif 412 SET_HELP_START(mode, pi, current_pos(0));413 444 BEGIN(phead); 414 445 } … … 416 447 <pdef>. { 417 448 if(brace2<=0) { 418 SET_HELP_START(mode, pi, current_pos(0));419 449 BEGIN(phead); 450 yyless(0); 420 451 } 421 452 } 422 453 423 <phead>"\\{" { } 424 <phead>"{" { 425 brace1++; BEGIN(pbody); 454 <phead>({tnl}+{quote}+{strings}+{escquote}+{tnl}+"{") { 426 455 #if YYLPDEBUG 427 printf("BEGIN(pbody){=%d, (=%d, [=%d\n", brace1, brace2, brace3); 428 #endif 429 SET_BODY_START(mode, pi, yylplineno, current_pos(0)); 456 if(lpverbose>2)printf("0-Len=%d;\n", yyleng); 457 #endif 458 if(check) { 459 printf("Procedure %s (line %d) has OLD-STYLE-HELP!\n", 460 pi->procname, pi->data.s.proc_lineno); 461 } 462 SET_HELP_START(mode, pi, current_pos(0)); 463 BEGIN(poldhelp); 464 yyless(0); 465 } 466 <phead>({tnl}+{quote}+{strings}+{eos}) { 430 467 #if YYLPDEBUG 431 printf("BODY at %d/%d", yylplineno, current_pos(0)); 432 #endif 433 } 434 <phead>\n { yylplineno++; } 435 <phead>. { } 468 if(lpverbose>2)printf("1-Len=%d;\n", yyleng); 469 #endif 470 BEGIN(phelp); 471 yyless(0); 472 } 473 <phead>{escstrings}+"{" { 474 if(check && yyleng>2) { 475 printf("Procedure %s (line %d) has OLD-STYLE-HELP!\n", 476 pi->procname, pi->data.s.proc_lineno); 477 } 478 #if YYLPDEBUG 479 if(lpverbose>2 && yyleng>2) 480 printf("2-Len=%d, %s;\n", yyleng, pi->procname); 481 #endif 482 SET_HELP_START(mode, pi, current_pos(0)); 483 BEGIN(poldhelp); 484 yyless(0); 485 } 486 <phead>. { printf("[%s]", yytext); } 487 488 <poldhelp>{escbrack} { } 489 <poldhelp>"{" { 490 brace1++; BEGIN(pbody); 491 #if YYLPDEBUG > 1 492 printf("BEGIN(pbody){=%d, (=%d, [=%d\n", brace1, brace2, brace3); 493 #endif 494 SET_BODY_START(mode, pi, yylplineno, current_pos(0)); 495 #if YYLPDEBUG > 1 496 printf("BODY at %d/%d", yylplineno, current_pos(0)); 497 #endif 498 } 499 <poldhelp>\n { yylplineno++; } 500 <poldhelp>. { } 501 502 <phelp>{quote} { 503 old_state = YYSTATE; 504 BEGIN(string); 505 SET_HELP_START(mode, pi, current_pos(1)); 506 } 507 <phelp>{tos} {} 508 <phelp>"{" { 509 brace1++; BEGIN(pbody); 510 #if YYLPDEBUG > 1 511 printf("BEGIN(pbody){=%d, (=%d, [=%d\n", brace1, brace2, brace3); 512 #endif 513 SET_BODY_START(mode, pi, yylplineno, current_pos(0)); 514 #if YYLPDEBUG > 1 515 printf("BODY at %d/%d", yylplineno, current_pos(0)); 516 #endif 517 } 518 <phelp>\n { yylplineno++; } 436 519 437 520 <pbody>({comment}[^\n]*) { } 438 <pbody>"\"" { quote++; old_state = YYSTATE; 439 BEGIN(string); /* printf("%s", yytext); */ 440 } 441 <pbody>"{" { 442 brace1++; 443 #if YYLPDEBUG 444 printf("line: %d, (%d)%s\n", yylplineno, brace1, yytext); 445 #endif 446 } 521 <pbody>{quote} { quote++; old_state = YYSTATE; 522 BEGIN(string); /* printf("%s", yytext); */ 523 } 524 525 <pbody>proc+{tos}+{name}+{tnl}+{paramlist}+{tnl}+"{" { 526 if(check) printf("*** found 2 proc whithin procedure '%s'.\n", 527 pi->procname); 528 yyless(yyleng-1); 529 } 530 <pbody>proc+{tos}+{name}+{tnl}+"{" { 531 if(check) printf("*** found 1 proc whithin procedure '%s'.\n", 532 pi->procname); 533 yyless(yyleng-1); 534 } 535 <pbody>"{" { 536 brace1++; 537 #if YYLPDEBUG > 1 538 printf("line: %d, (%d)%s\n", yylplineno, brace1, yytext); 539 #endif 540 } 447 541 <pbody>"}" { 448 #if YYLPDEBUG 542 #if YYLPDEBUG > 1 449 543 printf("line: %d, (%d)%s\n", yylplineno, brace1, yytext); 450 544 #endif … … 461 555 SET_BODY_END(mode, pi, current_pos(yyleng)); 462 556 SET_PROC_END(mode, pi, current_pos(yyleng)); 463 #if YYLPDEBUG 557 #if YYLPDEBUG > 1 464 558 printf("-%d\n", current_pos(0)); 465 559 #endif … … 545 639 \r { } 546 640 ; { p_static = FALSE; 547 #if YYLPDEBUG 641 #if YYLPDEBUG > 1 548 642 printf("%s", yytext); 549 643 #endif … … 552 646 yylp_errno = YYLP_BAD_CHAR; 553 647 printf("[%d]", *yytext); 554 #if YYLPDEBUG 648 #if YYLPDEBUG > 1 555 649 printf("[%s]", yytext); 556 650 #endif … … 612 706 strcat(libnamebuf,date); 613 707 strcat(libnamebuf,")"); 614 // printf("ID=(%d)%s; \n", what, p); 708 if(what && strcmp(libnamebuf, "(?.?,?)")==0) { 709 sscanf(p,"%*[^\"]\"%[^\"]\"",libnamebuf); 710 } 711 //printf("ID=(%d)%s; \n", what, p); 615 712 } 616 713 … … 652 749 { 653 750 lib_style_types lib_style; 654 ++argv, --argc; /* skip over program name */ 655 if ( argc > 0 ) 656 yyin = myfopen( argv[0], "rb" ); 657 else 658 yyin = stdin; 751 main_init(argc, argv); 752 if(lpverbose)printf("Verbose level=%d\n", lpverbose); 753 if(check)printf("Reporting most possible annomalies.\n"); 754 if(lpverbose||check)printf("\n"); 659 755 660 756 printf( " %-15s %20s %s,%s %s,%s %s,%s\n", "Library", … … 668 764 } 669 765 else if(pi!=NULL) printpi(pi); 766 main_result(argv[0]); 670 767 } 671 768 -
Singular/utils.cc
r4996f52 rd2b2a7 5 5 #include "utils.h" 6 6 7 extern FILE *yylpin; 8 extern char *optarg; 9 extern int optind, opterr, optopt; 10 extern int lpverbose, check; 11 extern int found_version, found_info, found_oldhelp, found_proc_in_proc; 12 warning_info = 0, warning_version = 0; 13 /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ 14 void main_init(int argc, char *argv[]) 15 { 16 char c, *file=NULL; 17 18 while(optind<argc) { 19 switch(c=getopt(argc, argv, "d:sf:")) 20 { 21 case 'd': 22 lpverbose = 1; 23 sscanf(optarg, "%d", &lpverbose); 24 break; 25 case 'f': file = argv[optind-1]; 26 // printf("opening:%d %s\n", optind, file); 27 break; 28 case 's': 29 check++; 30 break; 31 case -1 : printf("no such option:%s\n", argv[optind]); 32 break; 33 default: printf("no such option.%x, %s\n", c&0xff, argv[optind]); 34 } 35 } 36 37 if(file!=NULL) 38 yylpin = fopen( file, "rb" ); 39 else 40 yylpin = stdin; 41 } 42 43 /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ 44 void main_result(char *libname) 45 { 46 if(!found_info) printf("*** No info-string found!\n"); 47 if(!found_version) printf("*** No version-string found!\n"); 48 if(found_oldhelp) printf("*** Library has stil OLD library-format.\n"); 49 if(found_info && warning_info) 50 printf("*** INFO-string should come before every procedure definition.\n"); 51 if(found_version && warning_version) 52 printf("*** VERSION-string should come before every procedure definition.\n"); 53 } 7 54 /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ 8 55 … … 48 95 int len1, len2; 49 96 97 if(!found_info && !warning_info) warning_info++; 98 if(!found_version && !warning_version) warning_version++; 50 99 if(pi->data.s.body_end==0) 51 100 pi->data.s.body_end = pi->data.s.proc_end; … … 58 107 pi->data.s.example_lineno, pi->data.s.example_start, 59 108 pi->data.s.proc_end); 109 if(check) { 110 if(!pi->is_static && (pi->data.s.body_start-pi->data.s.def_end)<4) 111 printf("*** Procedure '%s' is global and has no help-section.\n", 112 pi->procname); 113 if(!pi->is_static && !pi->data.s.example_start) 114 printf("*** Procedure '%s' is global and has no example-section.\n",\ 115 pi->procname); 116 if(found_proc_in_proc) 117 printf("*** found proc within procedure '%s'.\n", pi->procname); 118 } 60 119 61 120 #if 0
Note: See TracChangeset
for help on using the changeset viewer.