Changeset a7a00b in git
- Timestamp:
- Jul 20, 2006, 4:51:56 PM (18 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- f11ebbbd9cb2500775acb3098085c5fffe4b4110
- Parents:
- 70cb9ba9c923dadb2e68e5c7a5a9ca40cf3dd144
- Location:
- Singular/LIB
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/general.lib
r70cb9b ra7a00b 3 3 //eric, added absValue 11.04.2002 4 4 /////////////////////////////////////////////////////////////////////////////// 5 version="$Id: general.lib,v 1. 49 2006-03-27 13:53:00Singular Exp $";5 version="$Id: general.lib,v 1.50 2006-07-20 14:51:56 Singular Exp $"; 6 6 category="General purpose"; 7 7 info=" … … 48 48 RETURN: string of n small (if a is small) or capital (if a is capital) 49 49 letters, comma separated, beginning with a, in alphabetical 50 order (or revers alphabetical order if n<0)50 order (or reverse alphabetical order if n<0) 51 51 EXAMPLE: example A_Z; shows an example 52 52 " … … 101 101 proc ASCII (list #) 102 102 "USAGE: ASCII([n,m]); n,m= integers (32 <= n <= m <= 126) 103 RETURN: string of printable ASCII characters (no native language support) 104 ASCII(): string of all ASCII characters with its numbers, 105 ASCII(n): n-th ASCII character 103 RETURN: string of printable ASCII characters (no native language support)@* 104 ASCII(): string of all ASCII characters with its numbers,@* 105 ASCII(n): n-th ASCII character@* 106 106 ASCII(n,m): n-th up to m-th ASCII character (inclusive) 107 107 EXAMPLE: example ASCII; shows an example … … 154 154 @* So the function can be applied to any type, for which comparison 155 155 @* operators are defined. 156 SEE ALSO: boolean expressions157 156 EXAMPLE: example absValue; shows an example 158 157 " … … 346 345 factorial(37);""; //37! of type string (as long integer) 347 346 ring r1 = 0,x,dp; 348 number p = factorial(37,0); //37! of type number, computed in r 347 number p = factorial(37,0); //37! of type number, computed in r1 349 348 p; 350 349 } … … 352 351 353 352 proc fibonacci (int n, list #) 354 "USAGE: fibonacci(n ); n,p integers353 "USAGE: fibonacci(n[,p]); n,p integers 355 354 RETURN: fibonacci(n): nth Fibonacci number, f(0)=f(1)=1, f(i+1)=f(i-1)+f(i) 356 355 @* - computed in characteristic 0, of type string … … 408 407 proc kmemory (list #) 409 408 "USAGE: kmemory([n,[v]]); n,v integers 410 RETURN: memory in kilobyte of type int409 RETURN: memory in kilobyte of type bigint 411 410 @* n=0: memory used by active variables (same as no parameters) 412 411 @* n=1: total memory allocated by Singular 413 @* n=2: difference between top and init memory adress (sbrk memory)414 @* n!=0,1,2: 0415 412 DISPLAY: detailed information about allocated and used memory if v!=0 416 413 NOTE: kmemory uses internal function 'memory' to compute kilobyte, and … … 828 825 829 826 proc sort (id, list #) 830 "USAGE: sort(id[ v,o,n]); id = ideal/module/intvec/list(of intvec's or int's)827 "USAGE: sort(id[,v,o,n]); id = ideal/module/intvec/list(of intvec's or int's) 831 828 @* sort may be called with 1, 2 or 3 arguments in the following way: 832 829 @* sort(id[,v,n]); v=intvec of positive integers, n=integer, … … 1115 1112 1116 1113 proc watchdog(int i, string cmd) 1117 "USAGE: watchdog(i,cmd); i integer ;cmd string1114 "USAGE: watchdog(i,cmd); i integer, cmd string 1118 1115 RETURN: Result of cmd, if the result can be computed in i seconds. 1119 1116 Otherwise the computation is interrupted after i seconds, … … 1261 1258 type(l[3])=typeof(n) 1262 1259 NOTE: If n is a long integer (of type number) then the procedure 1263 finds primefactors <= min(p,32003) but n may belarger as1260 finds primefactors <= min(p,32003) but n may as larger as 1264 1261 2147483647 (max. integer representation) 1265 1262 WARNING: the procedure works for small integers only, just by testing all … … 1434 1431 /////////////////////////////////////////////////////////////////////////////// 1435 1432 proc primecoeffs(J, list #) 1436 "USAGE: primecoeffs(J[, q]); J any type which can be converted to a matrix1433 "USAGE: primecoeffs(J[,p]); J any type which can be converted to a matrix 1437 1434 e.g. ideal, matrix, vector, module, int, intvec 1438 q = intger1435 p = integer 1439 1436 COMPUTE: primefactors <= min(p,32003) of coeffs of J (default p = 32003) 1440 RETURN: a list, say l, of two intvectors: 1441 l[1] : the different primefactors of all coefficients of J 1437 RETURN: a list, say l, of two intvectors:@* 1438 l[1] : the different primefactors of all coefficients of J@* 1442 1439 l[2] : the different remaining factors 1443 1440 NOTE: the procedure works for small integers only, just by testing all 1444 primes (not to be consider d as serious prime factorization!)1441 primes (not to be considered as serious prime factorization!) 1445 1442 EXAMPLE: example primecoeffs; shows an example 1446 1443 " … … 1514 1511 /////////////////////////////////////////////////////////////////////////////// 1515 1512 proc timeFactorize(poly i,list #) 1516 "USAGE: timeFactorize(p,d) 1513 "USAGE: timeFactorize(p,d); poly p , integer d 1517 1514 RETURN: factorize(p) if the factorization finished after d-1 1518 1515 seconds otherwhise f is considered to be irreducible … … 1669 1666 "USAGE: factorH(p) p poly 1670 1667 RETURN: factorize(p) 1671 NOTE: changes variables to become the last variable the principal1668 NOTE: changes variables to make the last variable the principal 1672 1669 one in the multivariate factorization and factorizes then 1673 1670 the polynomial -
Singular/LIB/inout.lib
r70cb9b ra7a00b 1 1 // (GMG/BM, last modified 22.06.96) 2 2 /////////////////////////////////////////////////////////////////////////////// 3 version="$Id: inout.lib,v 1.2 7 2006-05-18 13:51:36 Singular Exp $";3 version="$Id: inout.lib,v 1.28 2006-07-20 14:51:56 Singular Exp $"; 4 4 category="General purpose"; 5 5 info=" … … 26 26 DISPLAY: prints L[1], L[2], ... if an integer with name ALLprint is defined. 27 27 @* makes \"pause\", if ALLprint > 0 28 @* listvar(matrix), if ALLprint = 229 28 RETURN: no return value 30 29 EXAMPLE: example allprint; shows an example … … 35 34 int i; 36 35 for( i=1; i<=size(#); i=i+1 ) { print(#[i]); } 37 if( ALLprint==2 ) { pause(); listvar(matrix); }38 36 if( ALLprint >0 ) { pause(); } 39 37 } … … 53 51 "USAGE: lprint(id[,n]); id poly/ideal/vector/module/matrix, n integer 54 52 RETURN: string of id in a format fitting into lines of size n, such that no 55 monomial ge sts destroyed, i.e. the new line starts with + or -;53 monomial gets destroyed, i.e. the new line starts with + or -; 56 54 (default: n = pagewidth). 57 55 NOTE: id is printed columnwise, each column separated by a blank line; … … 112 110 113 111 proc pmat (matrix m, list #) 114 "USAGE: pmat(M ,[n]); M matrix, n integer112 "USAGE: pmat(M[,n]); M matrix, n integer 115 113 DISPLAY: display M in array format if it fits into pagewidth; if n is given, 116 114 only the first n characters of each colum are shown … … 184 182 proc rMacaulay 185 183 "USAGE: rMacaulay(s[,n]); s string, n integer 186 RETURN: A string which should be readable by Singular if s is a string which 187 was produced by Macaulay. If a second argument is present the first 184 RETURN: A string denoting a file which should be readable by Singular 185 and it should be produced by Macaulay Classic. 186 If a second argument is present the first 188 187 n lines of the file are deleted (which is useful if the file was 189 188 produced e.g. by the putstd command of Macaulay). … … 536 535 537 536 proc showrecursive (id,poly p,list #) 538 "USAGE: showrecursive(id,p[ ord]); id= any object of basering, p= product of537 "USAGE: showrecursive(id,p[,ord]); id= any object of basering, p= product of 539 538 variables and ord=string (any allowed ordstr) 540 539 DISPLAY: display 'id' in a recursive format as a polynomial in the variables … … 641 640 call the list `name`, keeping the list structure 642 641 RETURN: no return value 643 NOTE: The syntax of writelist uses andis similar to the syntax of the642 NOTE: The syntax of writelist is similar to the syntax of the 644 643 write command of Singular which does not manage lists properly. 645 644 If (file,name) = (\"listfile\",\"L1\"), writelist creates (resp. 646 645 appends if listfile exists) a file with name listfile and stores 647 646 there the list L under the name L1. The Singular command 648 execute(read(\"listfile\")); assign es the content of L (stored in647 execute(read(\"listfile\")); assigns the content of L (stored in 649 648 listfile) to a list L1. 650 649 @* On a UNIX system, write(\">file\",...) overwrites an existing file … … 687 686 "USAGE: pause([ prompt ]) prompt string 688 687 RETURN: none 689 PURPOSE: interrupt the execution of commands until user input 688 PURPOSE: interrupt the execution of commands, displays prompt or pause 689 and waits for user input 690 690 NOTE: pause is useful in procedures in connection with printlevel to 691 691 interrupt the computation and to display intermediate results. -
Singular/LIB/poly.lib
r70cb9b ra7a00b 1 1 /////////////////////////////////////////////////////////////////////////////// 2 version="$Id: poly.lib,v 1.3 7 2005-05-18 18:07:51 levandovExp $";2 version="$Id: poly.lib,v 1.38 2006-07-20 14:51:56 Singular Exp $"; 3 3 category="General purpose"; 4 4 info=" 5 5 LIBRARY: poly.lib Procedures for Manipulating Polys, Ideals, Modules 6 AUTHORS: O. Bachmann, G.-M :Greuel, A. Fruehbis6 AUTHORS: O. Bachmann, G.-M. Greuel, A. Fruehbis 7 7 8 8 PROCEDURES: … … 49 49 50 50 proc hilbPoly(ideal I) 51 "USAGE: hilbPoly(I) I a homogeneous ideal51 "USAGE: hilbPoly(I); I a homogeneous ideal 52 52 RETURN: the Hilbert polynomial of basering/I as an intvec v=v_0,...,v_r 53 53 such that the Hilbert polynomial is (v_0+v_1*t+...v_r*t^r)/r! … … 97 97 can be mapped, v,v1,v2,.. ring variables, f,f1,f2,... poly 98 98 @* - case 2: typeof(#[1])==ideal: 99 substitute 1(I,v,f); I object of basering which can be mapped,99 substitute (I,v,f); I object of basering which can be mapped, 100 100 v ideal of ring variables, f ideal 101 101 RETURN: object of same type as I, … … 191 191 192 192 proc katsura 193 "USAGE: katsura([n]) :n integer193 "USAGE: katsura([n]); n integer 194 194 RETURN: katsura(n) : n-th katsura ideal of 195 195 (1) newly created and set ring (32003, x(0..n), dp), if … … 326 326 proc maxcoef (f) 327 327 "USAGE: maxcoef(f); f poly/ideal/vector/module/matrix 328 RETURN: maximal length of coefficient of f of type int (by counting the328 RETURN: maximal length of coefficient of f of type int (by measuring the 329 329 length of the string of each coefficient) 330 330 EXAMPLE: example maxcoef; shows examples … … 367 367 (maxdeg of each var is 1). 368 368 Of type int if id is of type poly, of type intmat else 369 NOTE: proc maxdeg1 returns 1integer, the absolute maximum; moreover, it has369 NOTE: proc maxdeg1 returns an integer, the absolute maximum; moreover, it has 370 370 an option for computing weighted degrees 371 SEE ALSO: maxdeg1 371 372 EXAMPLE: example maxdeg; shows examples 372 373 " … … 634 635 proc normalize (id) 635 636 "USAGE: normalize(id); id=poly/vector/ideal/module 636 RETURN: object of same type with leading coefficient equal to 1 637 RETURN: object of same type,s 638 each element is normalized to make its leading coefficient equal to 1 637 639 EXAMPLE: example normalize; shows an example 638 640 " … … 702 704 "USAGE: lcm(p[,q]); p int/intvec q a list of integers or 703 705 p poly/ideal q a list of polynomials 704 RETURN: the least common multiple of the common entries ofp and q:706 RETURN: the least common multiple of p and q: 705 707 @* - of type int if p is an int/intvec 706 708 @* - of type poly if p is a poly/ideal
Note: See TracChangeset
for help on using the changeset viewer.