Changeset a7a00b in git for Singular/LIB/general.lib


Ignore:
Timestamp:
Jul 20, 2006, 4:51:56 PM (17 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
Children:
f11ebbbd9cb2500775acb3098085c5fffe4b4110
Parents:
70cb9ba9c923dadb2e68e5c7a5a9ca40cf3dd144
Message:
*hannes: Santiagos changes


git-svn-id: file:///usr/local/Singular/svn/trunk@9334 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/general.lib

    r70cb9b ra7a00b  
    33//eric, added absValue 11.04.2002
    44///////////////////////////////////////////////////////////////////////////////
    5 version="$Id: general.lib,v 1.49 2006-03-27 13:53:00 Singular Exp $";
     5version="$Id: general.lib,v 1.50 2006-07-20 14:51:56 Singular Exp $";
    66category="General purpose";
    77info="
     
    4848RETURN:  string of n small (if a is small) or capital (if a is capital)
    4949         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)
    5151EXAMPLE: example A_Z; shows an example
    5252"
     
    101101proc ASCII (list #)
    102102"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
     103RETURN:   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@*
    106106          ASCII(n,m): n-th up to m-th ASCII character (inclusive)
    107107EXAMPLE: example ASCII; shows an example
     
    154154@*       So the function can be applied to any type, for which comparison
    155155@*       operators are defined.
    156 SEE ALSO: boolean expressions
    157156EXAMPLE: example absValue; shows an example
    158157"
     
    346345   factorial(37);"";                 //37! of type string (as long integer)
    347346   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
    349348   p;
    350349}
     
    352351
    353352proc fibonacci (int n, list #)
    354 "USAGE:    fibonacci(n);  n,p integers
     353"USAGE:    fibonacci(n[,p]);  n,p integers
    355354RETURN:   fibonacci(n): nth Fibonacci number, f(0)=f(1)=1, f(i+1)=f(i-1)+f(i)
    356355@*        - computed in characteristic 0, of type string
     
    408407proc kmemory (list #)
    409408"USAGE:   kmemory([n,[v]]); n,v integers
    410 RETURN:  memory in kilobyte of type int
     409RETURN:  memory in kilobyte of type bigint
    411410@*       n=0: memory used by active variables (same as no parameters)
    412411@*       n=1: total memory allocated by Singular
    413 @*       n=2: difference between top and init memory adress (sbrk memory)
    414 @*       n!=0,1,2: 0
    415412DISPLAY: detailed information about allocated and used memory if v!=0
    416413NOTE:    kmemory uses internal function 'memory' to compute kilobyte, and
     
    828825
    829826proc 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)
    831828@*       sort may be called with 1, 2 or 3 arguments in the following way:
    832829@*       sort(id[,v,n]); v=intvec of positive integers, n=integer,
     
    11151112
    11161113proc watchdog(int i, string cmd)
    1117 "USAGE:   watchdog(i,cmd); i integer; cmd string
     1114"USAGE:   watchdog(i,cmd); i integer, cmd string
    11181115RETURN:  Result of cmd, if the result can be computed in i seconds.
    11191116         Otherwise the computation is interrupted after i seconds,
     
    12611258                type(l[3])=typeof(n)
    12621259NOTE:    If n is a long integer (of type number) then the procedure
    1263          finds primefactors <= min(p,32003) but n may be larger as
     1260         finds primefactors <= min(p,32003) but n may as larger as
    12641261         2147483647 (max. integer representation)
    12651262WARNING: the procedure works for small integers only, just by testing all
     
    14341431///////////////////////////////////////////////////////////////////////////////
    14351432proc primecoeffs(J, list #)
    1436 "USAGE:   primecoeffs(J[,q]); J any type which can be converted to a matrix
     1433"USAGE:   primecoeffs(J[,p]); J any type which can be converted to a matrix
    14371434         e.g. ideal, matrix, vector, module, int, intvec
    1438          q = intger
     1435         p = integer
    14391436COMPUTE: 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
     1437RETURN:  a list, say l, of two intvectors:@*
     1438         l[1] : the different primefactors of all coefficients of J@*
    14421439         l[2] : the different remaining factors
    14431440NOTE:    the procedure works for small integers only, just by testing all
    1444          primes (not to be considerd as serious prime factorization!)
     1441         primes (not to be considered as serious prime factorization!)
    14451442EXAMPLE: example primecoeffs; shows an example
    14461443"
     
    15141511///////////////////////////////////////////////////////////////////////////////
    15151512proc timeFactorize(poly i,list #)
    1516 "USAGE:  timeFactorize(p,d)  poly p , integer d
     1513"USAGE:  timeFactorize(p,d); poly p , integer d
    15171514RETURN:  factorize(p) if the factorization finished after d-1
    15181515         seconds otherwhise f is considered to be irreducible
     
    16691666"USAGE:  factorH(p)  p poly
    16701667RETURN:  factorize(p)
    1671 NOTE:    changes variables to become the last variable the principal
     1668NOTE:    changes variables to make the last variable the principal
    16721669         one in the multivariate factorization and factorizes then
    16731670         the polynomial
Note: See TracChangeset for help on using the changeset viewer.