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


Ignore:
Timestamp:
May 5, 1998, 1:55:40 PM (26 years ago)
Author:
Kai Krüger <krueger@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
97f92aa6d280f6022eaae47195ccc02503ccb984
Parents:
4996f5286c7671191ad22e654499fd8b752fe4f0
Message:
Modified Files:
	libparse.l utils.cc LIB/classify.lib LIB/deform.lib
	LIB/elim.lib LIB/factor.lib LIB/fastsolv.lib LIB/finvar.lib
	LIB/general.lib LIB/hnoether.lib LIB/homolog.lib LIB/inout.lib
	LIB/invar.lib LIB/makedbm.lib LIB/matrix.lib LIB/normal.lib
	LIB/poly.lib LIB/presolve.lib LIB/primdec.lib LIB/primitiv.lib
	LIB/random.lib LIB/ring.lib LIB/sing.lib LIB/standard.lib
	LIB/tex.lib LIB/tst.lib
Changed help section o procedures to have an quoted help-string between
proc-definition and proc-body.


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

Legend:

Unmodified
Added
Removed
  • 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 $
    22//system("random",787422842);
    33//(GMG, last modified 22.06.96)
    44///////////////////////////////////////////////////////////////////////////////
    55
    6 version="$Id: general.lib,v 1.6 1998-04-23 17:09:20 Singular Exp $";
     6version="$Id: general.lib,v 1.7 1998-05-05 11:55:27 krueger Exp $";
    77info="
    88LIBRARY:  general.lib   PROCEDURES OF GENERAL TYPE
     
    3030
    3131proc 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)
    3333RETURN:  string of n small (if a is small) or capital (if a is capital)
    3434         letters, comma seperated, beginning with a, in alphabetical
    3535         order (or revers alphabetical order if n<0)
    3636EXAMPLE: example A_Z; shows an example
     37"
    3738{
    3839  if ( n>=-26 and n<=26 and n!=0 )
     
    8586
    8687proc binomial (int n, int k, list #)
    87 USAGE:   binomial(n,k[,p/s]); n,k,p integers, s string
     88"USAGE:   binomial(n,k[,p/s]); n,k,p integers, s string
    8889RETURN:  binomial(n,k);    binomial coefficient n choose k of type int
    8990                           (machine integer, limited size! )
     
    9293                           in char of basering if a basering is defined
    9394EXAMPLE: example binomial; shows an example
     95"
    9496{
    9597   if ( size(#)==0 ) { int rr=1; }
     
    120122
    121123proc factorial (int n, list #)
    122 USAGE:   factorial(n[,string]);  n integer
     124"USAGE:   factorial(n[,string]);  n integer
    123125RETURN:  factorial(n); string of n! in char 0
    124126         factorial(n,s);  n! of type number (s any string), computed in char of
    125127         basering if a basering is defined
    126128EXAMPLE: example factorial; shows an example
     129"
    127130{
    128131   if ( size(#)==0 ) { ring R = 0,x,dp; poly r=1; }
     
    148151
    149152proc fibonacci (int n, list #)
    150 USAGE:   fibonacci(n[,string]);  (n integer)
     153"USAGE:   fibonacci(n[,string]);  (n integer)
    151154RETURN:  fibonacci(n); string of nth Fibonacci number,
    152155            f(0)=f(1)=1, f(i+1)=f(i-1)+f(i)
     
    154157         computed in characteristic of basering if a basering is defined
    155158EXAMPLE: example fibonacci; shows an example
     159"
    156160{
    157161   if ( size(#)==0 ) { ring fibo = 0,x,dp; number f=1; }
     
    177181
    178182proc kmemory ()
    179 USAGE:   kmemory();
     183"USAGE:   kmemory();
    180184RETURN:  memory used by active variables, of type int (in kilobyte)
    181185EXAMPLE: example kmemory; shows an example
     186"
    182187{
    183188  if ( voice==2 ) { "// memory used by active variables (kilobyte):"; }
     
    191196
    192197proc 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\");
    196201COMPUTE: 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-defined
    199          variables, except those of type "type_name" and except loaded procedures
     202         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
    200205RETURN:  no return value
    201206NOTE:    killall should never be used inside a procedure
    202207EXAMPLE: example killall; shows an example AND KILLS ALL YOUR VARIABLES
     208"
    203209{
    204210   list L=names(); int joni=size(L);
     
    255261
    256262proc number_e (int n)
    257 USAGE:   number_e(n);  n integer
     263"USAGE:   number_e(n);  n integer
    258264COMPUTE: exp(1) up to n decimal digits (no rounding)
    259265         by A.H.J. Sale's algorithm
     
    262268         display its decimal format
    263269EXAMPLE: example number_e; shows an example
     270"
    264271{
    265272   int i,m,s,t;
     
    296303
    297304proc number_pi (int n)
    298 USAGE:   number_pi(n);  n positive integer
     305"USAGE:   number_pi(n);  n positive integer
    299306COMPUTE: pi (area of unit circle) up to n decimal digits (no rounding)
    300307         by algorithm of S. Rabinowitz
     
    303310         its decimal format
    304311EXAMPLE: example number_pi; shows an example
     312"
    305313{
    306314   int i,m,t,e,q,N;
     
    366374
    367375proc primes (int n, int m)
    368 USAGE:   primes(n,m);  n,m integers
     376"USAGE:   primes(n,m);  n,m integers
    369377RETURN:  intvec, consisting of all primes p, prime(n)<=p<=m, in increasing
    370378         order if n<=m, resp. prime(m)<=p<=n, in decreasing order if m<n
    371379NOTE:    prime(n); returns the biggest prime number <= n (if n>=2, else 2)
    372380EXAMPLE: example primes; shows an example
     381"
    373382{  int change;
    374383   if ( n>m ) { change=n; n=m ; m=change; change=1; }
     
    386395
    387396proc product (id, list #)
    388 USAGE:    product(id[,v]); id=ideal/vector/module/matrix
     397"USAGE:    product(id[,v]); id=ideal/vector/module/matrix
    389398          resp.id=intvec/intmat, v=intvec (e.g. v=1..n, n=integer)
    390399RETURN:   poly resp. int which is the product of all entries of id, with index
     
    393402          identified with corresponding matrix M (columns of M generate m)
    394403EXAMPLE:  example product; shows an example
     404"
    395405{
    396406   int n,j;
     
    431441
    432442proc ringweights (r)
    433 USAGE:   ringweights(r); r ring
     443"USAGE:   ringweights(r); r ring
    434444RETURN:  intvec of weights of ring variables. If, say, x(1),...,x(n) are the
    435445         variables of the ring r, in this order, the resulting intvec is
     
    439449         the resulting intvec is 1,...,1
    440450EXAMPLE: example ringweights; shows an example
     451"
    441452{
    442453   int i; intvec v; setring r;
     
    456467
    457468proc 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)
    459470         sort may be called with 1, 2 or 3 arguments in the following way:
    460471         -  sort(id[v,n]); v=intvec, n=integer,
     
    488499         Zero generators of ideal/module are deleted
    489500EXAMPLE: example sort; shows an example
     501"
    490502{
    491503   int ii,jj,s,n = 0,0,1,0;
     
    580592
    581593proc 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,
    583595                       v=intvec (e.g. v=1..n, n=integer)
    584596RETURN:   poly resp. int which is the sum of all entries of id, with index
     
    587599          identified with corresponding matrix M (columns of M generate m)
    588600EXAMPLE:  example sum; shows an example
     601"
    589602{
    590603   if( typeof(id)=="poly" or typeof(id)=="ideal" or typeof(id)=="vector"
     
    625638
    626639proc which (command)
    627 USAGE:    which(command); command = string expression
     640"USAGE:    which(command); command = string expression
    628641RETURN:   Absolute pathname of command, if found in search path.
    629642          Empty string, otherwise.
    630643NOTE:     Based on the Unix command 'which'.
    631644EXAMPLE:  example which; shows an example
     645"
    632646{
    633647   int rs;
Note: See TracChangeset for help on using the changeset viewer.