Changeset a7a00b in git for Singular/LIB/general.lib
- Timestamp:
- Jul 20, 2006, 4:51:56 PM (17 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- Children:
- f11ebbbd9cb2500775acb3098085c5fffe4b4110
- Parents:
- 70cb9ba9c923dadb2e68e5c7a5a9ca40cf3dd144
- File:
-
- 1 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
Note: See TracChangeset
for help on using the changeset viewer.