Changeset 1a3911 in git


Ignore:
Timestamp:
Apr 6, 2009, 2:39:02 PM (14 years ago)
Author:
Frank Seelisch <seelisch@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
Children:
08e081516771eec845058a046616a8c0d7e8325b
Parents:
7de8e4cf4e88e60e523f5ebb65a61c114ff3674a
Message:
removed some docu errors prior to release 3-1-0


git-svn-id: file:///usr/local/Singular/svn/trunk@11626 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
Singular/LIB
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/aksaka.lib

    r7de8e4 r1a3911  
    11//CM, last modified 10.12.06
    22///////////////////////////////////////////////////////////////////////////////
    3 version="$Id: aksaka.lib,v 1.3 2009-02-21 10:02:00 Singular Exp $";
     3version="$Id: aksaka.lib,v 1.4 2009-04-06 12:39:02 seelisch Exp $";
    44category="Teaching";
    55info="
    6 LIBRARY: aksaka.lib
    7          Procedures for primality testing after Agrawal, Saxena, Kayal
     6LIBRARY: aksaka.lib     Procedures for primality testing after Agrawal, Saxena, Kayal
    87AUTHORS: Christoph Mang
    98
    10 OVERVIEV:
     9OVERVIEW:
    1110 Algorithms for primality testing in polynomial time
    1211 based on the ideas of Agrawal, Saxena and  Kayal.
     
    1413PROCEDURES:
    1514
    16 schnellexpt(a,m,n)         a^m for numbers a,m; if a^k>n n+1 is returned
     15fastExpt(a,m,n)         a^m for numbers a,m; if a^k>n n+1 is returned
    1716log2(n)                    logarithm to basis 2 of n
    1817PerfectPowerTest(n)        checks if there are a,b>1, so that a^b=n
     
    3231//                                                           //
    3332///////////////////////////////////////////////////////////////
    34 proc schnellexpt(number a,number m,number n)
    35 "USAGE: schnellexpt(a,m,n);
     33proc fastExpt(number a,number m,number n)
     34"USAGE: fastExpt(a,m,n); a, m, n = number;
    3635RETURN: the m-th power of a; if a^m>n the procedure returns n+1
    3736NOTE:   uses fast exponentiation
    38 EXAMPLE:example schnellexpt; shows an example
     37EXAMPLE:example fastExpt; shows an example
    3938"
    4039{
     
    6564{ "EXAMPLE:"; echo = 2;
    6665   ring R = 0,x,dp;
    67    schnellexpt(2,10,1022);
     66   fastExpt(2,10,1022);
    6867}
    6968////////////////////////////////////////////////////////////////////////////
     
    264263    {
    265264      m=intPart((a+c)/2);
    266       p=schnellexpt(m,b,n);
     265      p=fastExpt(m,b,n);
    267266
    268267      if(p==n)
  • Singular/LIB/atkins.lib

    r7de8e4 r1a3911  
    11///////////////////////////////////////////////////////////////////////////////
    2 version="$Id: atkins.lib,v 1.5 2008-10-09 09:31:57 Singular Exp $";
     2version="$Id: atkins.lib,v 1.6 2009-04-06 12:39:02 seelisch Exp $";
    33category="Teaching";
    44info="
    55LIBRARY:  atkins.lib     Procedures for teaching cryptography
    6 AUTHOR:                  Stefan Steidel, Stefan.Steidel@gmx.de
     6AUTHOR:                  Stefan Steidel, steidel@mathematik.uni-kl.de
    77
    88NOTE: The library contains auxiliary procedures to compute the elliptic
    99       curve primality test of Atkin and the Atkin's Test itself.
    1010       The library is intended to be used for teaching purposes but not
    11        for serious computations. Sufficiently high printLevel allows to
     11       for serious computations. Sufficiently high printlevel allows to
    1212       control each step, thus illustrating the algorithms at work.
    1313
     
    2020  CornacchiaModified(D,p)   computes solution (x,y) for x^2+|D|*y^2=4p
    2121  maximum(L)                computes the maximal number contained in L
     22  sqr(w,k)                  computes the square root of w w.r.t. accuracy k
    2223  expo(z,k)                 computes exp(z)
    2324  jOft(t,k)                 computes the j-invariant of t
     
    9899proc disc(number N, int k)
    99100"USAGE: disc(N,k);
    100 RETURN: list L of negative discriminants D, sort in decreasing order
     101RETURN: list L of negative discriminants D, sorted in decreasing order
    101102ASSUME: D<0, D kongruent 0 or 1 modulo 4 and |D|<4N
    102103NOTE:   D=b^2-4*a, where 0<=b<=k and intPart((b^2)/4)+1<=a<=k for each b
     
    384385RETURN: e^z to the order k
    385386NOTE:   k describes the number of summands being calculated in the exponential power series
    386 EXAMPLE:example e; shows an example
     387EXAMPLE:example expo; shows an example
    387388"
    388389{
     
    412413ASSUME: t is a complex number with positive imaginary part
    413414NOTE:   k describes the number of summands being calculated in the power series,
    414         10*k is input for the procedure "e"
    415 EXAMPLE:example jot; shows an example
     415        10*k is input for the procedure @code{expo}
     416EXAMPLE:example jOft; shows an example
    416417"
    417418{
     
    513514RETURN: the monic polynomial of degree h(D) in Z[X] of which jOft((D+sqr(D))/2) is a root
    514515ASSUME: D is a negative discriminant
    515 NOTE:   k is input for the procedure "jot",
     516NOTE:   k is input for the procedure "jOft",
    516517        5*k is input for the procedure "sqr",
    517518        10*k describes the number of decimals being calculated in the complex numbers
    518 EXAMPLE:example HilbertClassPolynomial; shows an example
     519EXAMPLE:example HilbertClassPoly; shows an example
    519520"
    520521{
     
    773774         0, if the algorithm is not applicable, since there are too little discriminants
    774775ASSUME: N is coprime to 6 and different from 1
    775 NOTE:   - K/2 is input for the procedure "disc",
    776           K is input for the procedure "HilbertClassPolynomial",
    777           B describes the number of recursions being calculated
    778         - The basis of the algorithm is the following theorem:
     776NOTE:   K/2 is input for the procedure "disc",@*
     777        K is input for the procedure "HilbertClassPolynomial",@*
     778        B describes the number of recursions being calculated.@*
     779        The basis of the algorithm is the following theorem:
    779780          Let N be an integer coprime to 6 and different from 1 and E be an
    780781          ellipic curve modulo N. Assume that we know an integer m and a
    781           point P of E(Z/NZ) satisfying the following conditions.
    782            (1) There exists a prime divisor q of m such that q>(4-th root(N)+1)^2.
    783            (2) m*P=O(E)=(0:1:0).
    784            (3) (m/q)*P=(x:y:t) with t element of (Z/NZ)*.
     782          point P of E(Z/NZ) satisfying the following conditions.@*
     783           (1) There exists a prime divisor q of m such that q>(4-th root(N)+1)^2.@*
     784           (2) m*P=O(E)=(0:1:0).@*
     785           (3) (m/q)*P=(x:y:t) with t element of (Z/NZ)*.@*
    785786          Then N is prime.
    786787EXAMPLE:example Atkin; shows an example
     
    12001201    printlevel=1;
    12011202    Atkin(7691,100,5);
    1202     Atkin(8543,100,4);
    1203     Atkin(100019,100,5);
    12041203    Atkin(10000079,100,2);
    12051204}
  • Singular/LIB/crypto.lib

    r7de8e4 r1a3911  
    11//GP, last modified 28.6.06
    22///////////////////////////////////////////////////////////////////////////////
    3 version="$Id: crypto.lib,v 1.6 2008-10-09 09:31:57 Singular Exp $";
     3version="$Id: crypto.lib,v 1.7 2009-04-06 12:39:02 seelisch Exp $";
    44category="Teaching";
    55info="
     
    88
    99NOTE: The library contains procedures to compute the discrete logarithm,
    10       primaly-tests, factorization included elliptic curve methodes.
     10      primality-tests, factorization included elliptic curves.
    1111      The library is intended to be used for teaching purposes but not
    1212      for serious computations. Sufficiently high printlevel allows to
     
    6565proc decimal(string s)
    6666"USAGE:  decimal(s); s = string
    67 RETURN: the (decimal)number corresponding to the hexadecimal number s
     67RETURN: the (decimal) number corresponding to the hexadecimal number s
    6868EXAMPLE:example decimal; shows an example
    6969"
     
    103103proc exgcdN(number a, number n)
    104104"USAGE:  exgcdN(a,n);
    105 RETURN: a list s,t,d of numbers, d=gcd(a,n)=s*a+t*n
     105RETURN: a list s,t,d of numbers satisfying d=gcd(a,n)=s*a+t*n
    106106EXAMPLE:example exgcdN; shows an example
    107107"
     
    510510"USAGE:  babyGiant(b,y,p);
    511511RETURN: the discrete logarithm x: b^x=y mod p
    512 NOTE:   giant-step-baby-step
     512NOTE:   This procedure works based on Shank's baby step - giant step method.
    513513EXAMPLE:example babyGiant; shows an example
    514514"
     
    561561NOTE: Pollard's rho:
    562562       choose random f_0 in 0,...,p-2 ,e_0=0, define x_0=b^f_0, define
    563        x_i=y^e_ib^f_i as below. For i large enough there is i with
     563       x_i=y^e_i*b^f_i as below. For i large enough there is i with
    564564       x_(i/2)=x_i. Let s:=e_(i/2)-e_i mod p-1 and t:=f_i-f_(i/2) mod p-1,
    565565       d=gcd(s,p-1)=u*s+v*(p-1) then x=tu/d +j*(p-1)/d for some j (to be
     
    649649RETURN: 1 if n is prime, 0 else
    650650NOTE: probabilistic test of Miller-Rabin with k loops to test if n is prime.
    651        Using the theorem:If n is prime, n-1=2^s*r, r odd, then
     651       Using the theorem: If n is prime, n-1=2^s*r, r odd, then
    652652       powerN(a,r,n)=1 or powerN(a,r*2^i,n)=-1 for some i
    653653EXAMPLE:example MillerRabin; shows an example
     
    701701RETURN: 1 if n is prime, 0 else
    702702NOTE: probabilistic test of Soloway-Strassen with k loops to test if n is
    703        prime using the theorem:
    704        If n is prime then powerN(a,(n-1)/2,n)=Jacobi(a,n) mod n
     703       prime using the theorem: If n is prime then
     704       powerN(a,(n-1)/2,n)=Jacobi(a,n) mod n
    705705EXAMPLE:example SolowayStrassen; shows an example
    706706"
     
    746746        L a list of the first k primes
    747747RETURN:message N is not prime or {A,{p},{a_p}} as certificate for N being prime
    748 NOTE:assumes that it is possible to factorize N-1=A*B such that gcd(A,B)=1
     748NOTE:assumes that it is possible to factorize N-1=A*B such that gcd(A,B)=1,
    749749      the factorization of A is completely known and A^2>N .
    750750      N is prime if and only if for each prime factor p of A we can find
     
    830830"USAGE:  PollardRho(n,k,allFactors); optional: PollardRho(n,k,allFactors,L);
    831831         L a list of the first k primes
    832 RETURN: a list of factors of n (which could be just n),if allFactors=0
     832RETURN: a list of factors of n (which could be just n),if allFactors=0@*
    833833        a list of all factors of n ,if allFactors=1
    834834NOTE: probabilistic rho-algorithm of Pollard to find a factor of n in k loops.
     
    933933NOTE: Pollard's p-factorization
    934934       creates the product k of powers of primes (bounded by B)  from
    935        the list P with the idea that for a prime divisor p of n p-1|k
    936        then p devides gcd(a^k-1,n) for some random a
     935       the list P with the idea that for a prime divisor p of n we have
     936       p-1|k, and then p devides gcd(a^k-1,n) for some random a
    937937EXAMPLE:example pFactor; shows an example
    938938"
     
    974974         k for using the first k elements in B
    975975RETURN: a list of factors of n or the message: no divisor found
    976 NOTE: quadraticSieve: Idea is to find x,y such that x^2=y^2 mod n then
     976NOTE: The idea being used is to find x,y such that x^2=y^2 mod n then
    977977      gcd(x-y,n) can be a proper divisor of n
    978978EXAMPLE:example quadraticSieve; shows an example
     
    11281128"USAGE:  ellipticAdd(N,a,b,P,Q);
    11291129RETURN: list L, representing the point P+Q
    1130 NOTE: P=(P[1]:P[2]:P[3]),Q =(Q[1]:Q[2]:Q[3])points on the elliptic curve
     1130NOTE: P=(P[1]:P[2]:P[3]), Q=(Q[1]:Q[2]:Q[3]) points on the elliptic curve
    11311131      defined by y^2z=x^3+a*xz^2+b*z^3  over Z/N
    11321132EXAMPLE:example ellipticAdd; shows an example
     
    13501350RETURN: the number of points of the elliptic curve defined by
    13511351        y^2=x^3+a*x+b  over Z/N
    1352 NOTE: trivial aproach
     1352NOTE: trivial approach
    13531353EXAMPLE:example countPoints; shows an example
    13541354"
     
    14201420
    14211421proc ShanksMestre(number q, number a, number b, list #)
    1422 "USAGE:  ShanksMestre(q,a,b); optional:ShanksMestre(q,a,b,s); s the number
     1422"USAGE:  ShanksMestre(q,a,b); optional: ShanksMestre(q,a,b,s); s the number
    14231423         of loops in the algorithm (default s=1)
    14241424RETURN: the number of points of the elliptic curve defined by
    14251425         y^2=x^3+a*x+b  over Z/N
    1426 NOTE: algorithm of Shanks and Mestre (giant-step-baby-step)
     1426NOTE: algorithm of Shanks and Mestre (baby-step-giant-step)
    14271427EXAMPLE:example ShanksMestre; shows an example
    14281428"
     
    15751575"USAGE:  generateG(a,b,m);
    15761576RETURN: m-th division polynomial
    1577 NOTE: generate the recursively defined polynomials in Z[x,y],so called
    1578  division polynomials, p_m=generateG(a,b,m) such that on the elliptic curve
    1579  defined by y^2=x^3+a*x+b  over Z/N and a point P=(x:y:1) the point m*P is
    1580  (x-(p_(m-1)*p_(m+1))/p_m^2 :(p_(m+2)*p_(m-1)^2-p_(m-2)*p_(m+1)^2)/4y*p_m^3 :1)
    1581  m*P=0  iff p_m(P)=0
     1577NOTE: generate the so-called division polynomials, i.e., the recursively defined
     1578polynomials p_m=generateG(a,b,m) in Z[x, y] such that, for a point (x:y:1) on the
     1579elliptic curve defined by y^2=x^3+a*x+b  over Z/N the point@*
     1580m*P=(x-(p_(m-1)*p_(m+1))/p_m^2 :(p_(m+2)*p_(m-1)^2-p_(m-2)*p_(m+1)^2)/4y*p_m^3 :1)
     1581and m*P=0  iff p_m(P)=0
    15821582EXAMPLE:example generateG; shows an example
    15831583"
     
    18461846         d+1 the number of loops in the algorithm (default d=0)
    18471847RETURN: a factor of N or the message no factor found
    1848 NOTE: - computes a factor of N using Lenstra's ECM factorization
     1848NOTE: - computes a factor of N using Lenstra's ECM factorization@*
    18491849      - the idea is that the fact that N is not prime is dedected using
    18501850        the operations on the elliptic curve
     
    19011901proc ECPP(number N)
    19021902"USAGE:  ECPP(N);
    1903 RETURN: message:N is not prime or {L,P,m,q} as certificate for N being prime
    1904          L a list (y^2=x^3+L[1]*x+L[2] defines an elliptic curve C)
    1905          P a list ((P[1]:P[2]:P[3]) is a point of C)
     1903RETURN: message:N is not prime or {L,P,m,q} as certificate for N being prime@*
     1904         L a list (y^2=x^3+L[1]*x+L[2] defines an elliptic curve C)@*
     1905         P a list ((P[1]:P[2]:P[3]) is a point of C)@*
    19061906         m,q integers
    19071907ASSUME: gcd(N,6)=1
  • Singular/LIB/graphics.lib

    r7de8e4 r1a3911  
    11//last change: 13.02.2001 (Eric Westenberger)
    22///////////////////////////////////////////////////////////////////////////////
    3 version="$Id: graphics.lib,v 1.13 2009-04-06 09:17:01 seelisch Exp $";
     3version="$Id: graphics.lib,v 1.14 2009-04-06 12:39:02 seelisch Exp $";
    44category="Visualization";
    55info="
     
    88
    99PROCEDURES:
    10  staircase(fname,I);  Mathematica text for displaying staircase of I
     10 staircase(I);        Mathematica text for displaying staircase of I
    1111 mathinit();          string for loading Mathematica's ImplicitPlot
    1212 mplot(fname,I[# s]); Mathematica text for various plots
  • Singular/LIB/hyperel.lib

    r7de8e4 r1a3911  
    11///////////////////////////////////////////////////////////////////////////////
    2 version="$Id: hyperel.lib,v 1.1 2007-05-24 11:57:58 Singular Exp $";
     2version="$Id: hyperel.lib,v 1.2 2009-04-06 12:39:02 seelisch Exp $";
    33category="Teaching";
    44info="
    5 LIBRARY:    hyperelliptic.lib
     5LIBRARY:    hyperel.lib
    66AUTHOR:     Markus Hochstetter, markushochstetter@gmx.de
    77
    8  NOTE: This library provides procedures for computing with divisors in the
    9        jacobian of hyperelliptic curves. In addition procedures are available
    10        for computing the rational representation of divisors and vice versa.
    11        The library is intended to be used for teaching and demonstrating
    12        purposes but not for efficient computations.
     8NOTE: The library provides procedures for computing with divisors in the
     9      jacobian of hyperelliptic curves. In addition procedures are available
     10      for computing the rational representation of divisors and vice versa.
     11      The library is intended to be used for teaching and demonstrating
     12      purposes but not for efficient computations.
    1313
    1414
     
    3838
    3939proc ishyper(poly h, poly f)
    40 "USAGE:   ishyper(h,f); h,f poly
    41 RETURN:  1 if y^2+h(x)y=f(x) is hyperelliptic, else 0
     40"USAGE:   ishyper(h,f); h,f=poly
     41RETURN:  1 if y^2+h(x)y=f(x) is hyperelliptic, 0 otherwise
    4242NOTE:    Tests, if y^2+h(x)y=f(x) is a hyperelliptic curve.
    4343         Curve is defined over basering. Additionally shows error-messages.
     
    101101
    102102proc isoncurve(list P, poly h, poly f)
    103 "USAGE:   isoncurve(P,h,f); h,f poly
     103"USAGE:   isoncurve(P,h,f); h,f=poly; P=list
    104104RETURN:  1 or 0 (if P is on curve or not)
    105 NOTE:    Tests, if P=(P[1],P[2]) is on the hyperelliptic curve
    106          y^2+h(x)y=f(x) .
     105NOTE:    Tests, if P=(P[1],P[2]) is on the hyperelliptic curve y^2+h(x)y=f(x).
    107106         Curve is defined over basering.
    108107EXAMPLE: example isoncurve; shows an example
     
    147146
    148147proc chinrestp(list b,list moduli)
    149 "USAGE:   chinrestp(b,moduli);  b, moduli list of polynomials
    150 RETURN:  polynomial x, s.t. x= b[i] mod moduli[i]
     148"USAGE:   chinrestp(b,moduli); moduli, b, moduli=list of polynomials
     149RETURN:  poly x, s.t. x= b[i] mod moduli[i]
    151150NOTE:    chinese remainder theorem for polynomials
    152151EXAMPLE: example chinrestp; shows an example
     
    193192RETURN:  norm of a(x)-b(x)y in IF[C]
    194193NOTE:    The norm is a polynomial in just one variable.
    195          Curve C:y^2+h(x)y=f(x) is defined over basering.
     194         Curve C: y^2+h(x)y=f(x) is defined over basering.
    196195EXAMPLE: example norm; shows an example
    197196"
     
    217216"USAGE:   multi(a,b,c,d,h,f);
    218217RETURN:  list L with L[1]-L[2]y=(a(x)-b(x)y)*(c(x)-d(x)y) in IF[C]
    219 NOTE:    Curve C:y^2+h(x)y=f(x) is defined over basering.
     218NOTE:    Curve C: y^2+h(x)y=f(x) is defined over basering.
    220219EXAMPLE: example multi; shows an example
    221220"
     
    465464"USAGE:   divisor(a,b,h,f); optional: divisor(a,b,h,f,s); s=0,1
    466465RETURN:  list P
    467 NOTE:    P[1][3]*(P[1][1], P[1][2]) +...+ P[sizeof(P)][3]*
    468          *(P[sizeof(P)][1], P[sizeof(P)][2]) - (*)infty=div(a(x)-b(x)y)
     466NOTE:    P[1][3]*(P[1][1], P[1][2]) +...+ P[size(P)][3]*
     467         *(P[size(P)][1], P[size(P)][2]) - (*)infty=div(a(x)-b(x)y)
    469468         if there is an optional parameter s!=0, then divisor additonally
    470469         returns a parameter, which says, whether irreducible polynomials
    471470         occured during computations or not. Otherwise only warnings are
    472471         displayed on the monitor. For s=0 nothing happens.
    473          Curve C:y^2+h(x)y=f(x) is defined over basering.
     472         Curve C: y^2+h(x)y=f(x) is defined over basering.
    474473EXAMPLE: example divisor; shows an example
    475474"
     
    651650RETURN:  list P
    652651NOTE:    important: Divisor D has to be semireduced!
    653          Computes semireduced divisor
    654          P[1][3]*(P[1][1], P[1][2]) +...+ P[sizeof(P)][3]*
    655          *(P[sizeof(P)][1], P[sizeof(P)][2]) - (*)infty=div(D[1],D[2])
     652         Computes semireduced divisor P[1][3]*(P[1][1], P[1][2]) +...+ P[size(P)][3]*
     653         *(P[size(P)][1], P[size(P)][2]) - (*)infty=div(D[1],D[2])@*
    656654         Curve C:y^2+h(x)y=f(x) is defined over basering.
    657655EXAMPLE: example semidiv; shows an example
     
    695693NOTE:    Cantor's Algorithm - composition
    696694         important: D and Q have to be semireduced!
    697          Computes semireduced divisor
    698          div(P[1],P[2])= div(D[1],D[2]) + div(Q[1],Q[2])
     695         Computes semireduced divisor div(P[1],P[2])= div(D[1],D[2]) + div(Q[1],Q[2])
    699696         The divisors are defined over the basering.
    700          Curve C:y^2+h(x)y=f(x) is defined over the basering.
     697         Curve C: y^2+h(x)y=f(x) is defined over the basering.
    701698EXAMPLE: example cantoradd; shows an example
    702699"
     
    739736NOTE:    Cantor's algorithm - reduction.
    740737         important: Divisor D has to be semireduced!
    741          Computes reduced divisor div(N[1],N[2])= div(D[1],D[2]).
     738         Computes reduced divisor div(N[1],N[2])= div(D[1],D[2]).@*
    742739         The divisors are defined over the basering.
    743          Curve C:y^2+h(x)y=f(x) is defined over the basering.
     740         Curve C: y^2+h(x)y=f(x) is defined over the basering.
    744741EXAMPLE: example cantorred; shows an example
    745742"
     
    773770NOTE:    important: Divisor D has to be semireduced!
    774771         Special case of Cantor's algorithm.
    775          Computes reduced divisor div(Q[1],Q[2])= 2*div(D[1],D[2])
     772         Computes reduced divisor div(Q[1],Q[2])= 2*div(D[1],D[2]).@*
    776773         The divisors are defined over the basering.
    777774         Curve C:y^2+h(x)y=f(x) is defined over the basering.
     
    804801         Uses repeated doublings for a faster computation
    805802         of the reduced divisor m*D.
    806          Attention: Factor m is int, this means bounded.
     803         Attention: Factor m=int, this means bounded.
    807804         For m<0 the inverse of m*D is returned.
    808805         The divisors are defined over the basering.
    809          Curve C:y^2+h(x)y=f(x) is defined over the basering.
     806         Curve C: y^2+h(x)y=f(x) is defined over the basering.
    810807EXAMPLE: example cantormult; shows an example
    811808"
  • Singular/LIB/latex.lib

    r7de8e4 r1a3911  
    11///////////////////////////////////////////////////////////////////////////////
    2 version="$Id: latex.lib,v 1.30 2009-01-14 16:07:05 Singular Exp $";
     2version="$Id: latex.lib,v 1.31 2009-04-06 12:39:02 seelisch Exp $";
    33category="Visualization";
    44info="
     
    77
    88PROCEDURES:
    9  closetex(fnm);       writes closing line for LaTeX-document
    10  opentex(fnm);        writes header for LaTeX-file fnm
    11  tex(fnm);            calls LaTeX2e for LaTeX-file fnm
    12  texdemo([n]);        produces a file explaining the features of this lib
    13  texfactorize(fnm,f); creates string in LaTeX-format for factors of poly f
    14  texmap(fnm,m,r1,r2); creates string in LaTeX-format for map m:r1->r2
    15  texname(fnm,s);      creates string in LaTeX-format for identifier
    16  texobj(l);           creates string in LaTeX-format for any (basic) type
    17  texpoly(f,n[,l]);    creates string in LaTeX-format for poly
    18  texproc(fnm,p);      creates string in LaTeX-format of text from proc p
    19  texring(fnm,r[,l]);  creates string in LaTeX-format for ring/qring
    20  rmx(s);              removes .aux and .log files of LaTeX-files
    21  xdvi(s);             calls xdvi for dvi-files
    22          (parameters in square brackets [] are optional)
     9 closetex(fnm)       writes closing line for LaTeX-document
     10 opentex(fnm)        writes header for LaTeX-file fnm
     11 tex(fnm)            calls LaTeX2e for LaTeX-file fnm
     12 texdemo([n])        produces a file explaining the features of this lib
     13 texfactorize(fnm,f) creates string in LaTeX-format for factors of poly f
     14 texmap(fnm,m,r1,r2) creates string in LaTeX-format for map m:r1->r2
     15 texname(fnm,s)      creates string in LaTeX-format for identifier
     16 texobj(l)           creates string in LaTeX-format for any (basic) type
     17 texpoly(f,n[,l])    creates string in LaTeX-format for poly
     18 texproc(fnm,p)      creates string in LaTeX-format of text from proc p
     19 texring(fnm,r[,l])  creates string in LaTeX-format for ring/qring
     20 rmx(s)              removes .aux and .log files of LaTeX-files
     21 xdvi(s)             calls xdvi for dvi-files
     22        (parameters in square brackets [] are optional)
     23        (Procedures with file output assume sufficient write permissions
     24        when trying to append existing or create new files.)
    2325
    2426GLOBAL VARIABLES:
     
    578580proc texname(string fname, string s)
    579581"USAGE:   texname(fname,s);  fname,s  strings
    580 RETURN:  if @code{fname=\"\"}: string, the transformed string s, where the
     582RETURN:  if @code{fname=\"\"}: the transformed string s, for which the
    581583         following rules apply:
    582584@example
     
    588590\"(\" + int + \",\" + s' + \")\" --> \"_@{\"+ int +\"@}\" + \"^@{\" + s'+\"@}\"
    589591@end example
    590          Anyhow, strings which begin with a @code{\"@{\"} are only changed
    591          by deleting the first and last character (intended to remove the
    592          surrounding curly brackets).
     592         Furthermore, strings which begin with a @code{\"@{\"} are modified
     593         by deleting the first and the last character (which is then assumed to
     594         be a @code{\"@}\"}).
    593595
    594596         if @code{fname!=\"\"}: append the transformed string s to the file
     
    10511053         is added to @code{fname}.@*
    10521054         The optional list L is assumed to be a list of strings which control,
    1053          for instamce the symbol for the field of coefficients.@*
     1055         for instance the symbol for the field of coefficients.@*
    10541056         For more details call @code{texdemo();} (generates a LaTeX2e
    10551057         file called @code{texlibdemo.tex} which explains all features of
     
    12511253RETURN:  nothing; displays dvi-file fname.dvi with previewer xdvi
    12521254NOTE:    suffix .dvi may be omitted in fname
    1253          style overwrites the default setting xdvi
     1255         style captures the program that will be called instead of the default (xdvi)
    12541256EXAMPLE: example xdvi; shows an example
    12551257"
  • Singular/LIB/polymake.lib

    r7de8e4 r1a3911  
    1 version="$Id: polymake.lib,v 1.12 2009-03-25 11:31:32 keilen Exp $";
     1version="$Id: polymake.lib,v 1.13 2009-04-06 12:39:02 seelisch Exp $";
    22category="Tropical Geometry";
    33info="
     
    100100PURPOSE: the procedure calls polymake to compute the vertices of the polytope
    101101         as well as its dimension and information on its facets
    102 RETURN:  list, L with four entries
     102RETURN:  list L with four entries
    103103@*            L[1] : an integer matrix whose rows are the coordinates of vertices
    104104                     of the polytope
    105105@*            L[2] : the dimension of the polytope
    106 @*            L[3] : a list whose ith entry explains to which vertices the
     106@*            L[3] : a list whose i-th entry explains to which vertices the
    107107                     ith vertex of the Newton polytope is connected
    108108                     -- i.e. L[3][i] is an integer vector and an entry k in
     
    127127@*    -  moreover, the procedure creates the file /tmp/polytope.output which
    128128         it deletes again before ending
    129 @*    -  it is possible to give as an optional second argument as string
     129@*    -  it is possible to provide an optional second argument as string
    130130         which then will be used instead of 'polytope' in the name of the
    131131         polymake output file
  • Singular/LIB/rootsmr.lib

    r7de8e4 r1a3911  
    1 // $Id: rootsmr.lib,v 1.4 2008-03-18 15:51:41 Singular Exp $
     1// $Id: rootsmr.lib,v 1.5 2009-04-06 12:39:02 seelisch Exp $
    22// E. Tobis  12.Nov.2004, April 2004
    33// last change 7. May 2005 (G.-M. Greuel)
     
    303303
    304304proc tracemult(poly f,ideal B,ideal I)
    305 "USAGE:     tracemult(f,b,i);f poly, b,i ideal
    306 RETURN:    number: the trace of the multiplication by f (m_f) on r/i,
    307            written in the monomial basis b of r/i, r = basering
    308            (faster than matmult + trace)
    309 ASSUME:    i is a Groebner basis and b is an ordered monomial basis of r/i
     305"USAGE:     tracemult(f,B,I);f poly, B,I ideal
     306RETURN:    number: the trace of the multiplication by f (m_f) on r/I, written in
     307           the monomial basis B of r/I, r = basering (faster than matmult + trace)
     308ASSUME:    I is given by a Groebner basis and B is an ordered monomial basis of r/I
    310309SEE ALSO:  matmult,trace
    311310EXAMPLE:   example tracemult; shows an example"
     
    496495///////////////////////////////////////////////////////////////////////////////
    497496
    498 proc verify(poly p,ideal b,ideal i)
    499 "USAGE:     verify(p,b,i);p poly, b,i,ideal
    500 RETURN:    integer: 1 iff the polynomial p splits the points of V(i).
     497proc verify(poly p,ideal B,ideal I)
     498"USAGE:     verify(p,B,I); p poly, B,I,ideal
     499RETURN:    integer: 1 iff the polynomial p splits the points of V(I).
    501500           It's used to check the result of randcharpoly
    502 ASSUME:    i is a Groebner basis and b is an ordered monomial basis of r/i,
     501ASSUME:    I is given by a Groebner basis and B is an ordered monomial basis of r/I,
    503502           r = basering
    504503NOTE:      comments the result if printlevel>0 (default: printlevel=0)
     
    511510  poly variable;
    512511
    513   if (isparam(p) || isparam(b) || isparam(i)) {
     512  if (isparam(p) || isparam(B) || isparam(I)) {
    514513    ERROR("This procedure cannot operate with parametric arguments");
    515514  }
     
    517516  variable = isuni(p);
    518517  sqr_free = p/gcd(p,diff(p,variable));
    519   correct = (mat_rk(matbil(1,b,i)) == deg(sqr_free));
     518  correct = (mat_rk(matbil(1,B,I)) == deg(sqr_free));
    520519
    521520  if (correct) {
     
    594593  ring r = 0,(x,y,z),dp;
    595594
    596   ideal i = (x-1)*(x-2),(y-1),(z+5); // V(I) = {(1,1,-5),(2,1,-5)
     595  ideal i = (x-1)*(x-2),(y-1),(z+5); // V(I) = {(1,1,-5),(2,1,-5)}
    597596  i = std(i);
    598597
  • Singular/LIB/rootsur.lib

    r7de8e4 r1a3911  
    1 // $Id: rootsur.lib,v 1.6 2007-11-16 18:38:24 Singular Exp $
     1// $Id: rootsur.lib,v 1.7 2009-04-06 12:39:02 seelisch Exp $
    22// E. Tobis  12.Nov.2004, April 2004
    33// last change 5. May 2005 (G.-M. Greuel)
     
    6363proc isparam(list #)
    6464"USAGE:     isparam(ideal/module/poly/list);
    65 RETURN:    int: 0 if the argument has non-parametric coefficients
    66            and 1 if it has
     65RETURN:    int: 0 if the argument has non-parametric coefficients and 1 if it
     66           has parametric coefficients
    6767EXAMPLE:   example isparam; shows an example"
    6868{
     
    204204           with the same parity as the actual number of roots (using the
    205205           Budan-Fourier Theorem)
    206 ASSUME:    p is a univariate polynomial with rational coefficients
    207            a, b are rational numbers with a < b
     206ASSUME:    - p is a univariate polynomial with rational coefficients@*
     207           - a, b are rational numbers with a < b
    208208SEE ALSO:  boundposDes,varsigns
    209209EXAMPLE:   example boundBuFou; shows an example"
     
    457457"USAGE:     sturm(p,a,b); poly p, number a,b
    458458RETURN:    int: the number of real roots of p in (a,b]
    459 ASSUME:    p is a univariate polynomial with rational coefficients,
     459ASSUME:    p is a univariate polynomial with rational coefficients,@*
    460460           a, b are rational numbers with a < b
    461461SEE ALSO:  sturmha,allrealst,allreal
     
    522522ASSUME:    p is a univariate polynomial with rational coefficients
    523523THEORY:    The Sturm sequence of p (also called remainder sequence) is the
    524            sequence begininng with p, p' and goes on with the negative of the
    525            remainder of the two previous polynomials, until the remainder is
    526            zero.
     524           sequence beginning with p, p' and goes on with the negative part of
     525           the remainder of the two previous polynomials, until the remainder
     526           is zero.
    527527           See: Basu, Pollack, Roy, Algorithms in Real Algebraic Geometry,
    528528           Springer, 2003.
     
    614614proc sturmha(poly P,number a,number b)
    615615"USAGE:     sturmha(p,a,b); poly p, number a,b
    616 RETURN:    int: the number of real roots of p in (a,b) (using a
    617            Sturm-Habicht sequence)
     616RETURN:    int: the number of real roots of p in (a,b) (using a Sturm-Habicht sequence)
    618617SEE ALSO:  sturm,allreal
    619618EXAMPLE:   example sturmha; shows an example"
     
    683682proc sturmhaseq(poly P)
    684683"USAGE:     sturmhaseq(P); P poly.
    685 RETURN:    list: the nonzero polynomials of the Sturm-Habicht sequence of P
     684RETURN:    list: the non-zero polynomials of the Sturm-Habicht sequence of P
    686685ASSUME:    P is a univariate polynomial.
    687686THEORY:    The Sturm-Habicht sequence (also subresultant sequence) is closely
     
    805804  nrroots(p);
    806805  p = p*(x2+1);
    807   nrroots(p)
     806  nrroots(p);
    808807}
    809808///////////////////////////////////////////////////////////////////////////////
  • Singular/LIB/surf.lib

    r7de8e4 r1a3911  
    11// last modified 21.07.2005, Oliver Wienand
    22///////////////////////////////////////////////////////////////////////////////
    3 version="$Id: surf.lib,v 1.32 2009-02-17 11:47:48 Singular Exp $";
     3version="$Id: surf.lib,v 1.33 2009-04-06 12:39:02 seelisch Exp $";
    44category="Visualization";
    55info="
    66LIBRARY: surf.lib    Procedures for Graphics with Surf
    7 AUTHOR: Hans Schoenemann,
    8         the program surf is written by Stefan Endrass
     7AUTHOR: Hans Schoenemann
    98
    109NOTE:
    1110 @texinfo
    12  To use this library requires the program @code{surf} to be installed.
     11 Using this library requires the program @code{surf} to be installed.
    1312 You can download @code{surf} either from
    1413  @uref{http://sourceforge.net/projects/surf}
     
    1615 The procedure surfer requires the program @code{surfer} to be installed.
    1716 You can download @code{surfer} from
    18   @uref{http://www.imaginary2008.de/surfer.php}
     17  @uref{http://www.imaginary2008.de/surfer.imaginary2008.de}
    1918 @*Under Windows, version 159 or newer of @code{surfer} is required.
    2019 @end texinfo
  • Singular/LIB/surfex.lib

    r7de8e4 r1a3911  
    11//last change: 2007/07/06 (Oliver Labs)
    22///////////////////////////////////////////////////////////////////////////////
    3 version="$Id: surfex.lib,v 1.9 2009-01-14 16:07:05 Singular Exp $";
     3version="$Id: surfex.lib,v 1.10 2009-04-06 12:39:02 seelisch Exp $";
    44category="Visualization";
    55info="
     
    4646"
    4747USAGE: plotRot(poly p, list #)
    48 Similar to plotRotated, but guesses automatically
    49 which coordinates should be used.
     48Similar to plotRotated, but guesses automatically which coordinates should be used.
     49The optional int parameter can be used to set plotting quality.
    5050
    5151It opens the external program surfex for drawing the surface given by p,
     
    121121This opens the external program surfex for drawing the surface given by p,
    122122seen as a surface in the real affine space with coordinates coords.
     123The optional int parameter can be used to set plotting quality.
    123124
    124125ASSUME: coords is a list of three variables.
     
    152153This opens the external program surfex for drawing the surfaces given by varieties,
    153154seen as a surface in the real affine space with coordinates coords.
     155The optional int parameter can be used to set plotting quality.
    154156
    155157ASSUME: coords is a list of three variables, varieties is a list of ideals
     
    397399USAGE: plotRotatedListFromSpecifyList(list varietiesList, list #);
    398400varietiesList has a complicated format (not documented yet);
    399 see the example.
     401see the example.@*
     402The optional int parameter can be used to set plotting quality.
    400403
    401404ASSUME: The basering is of characteristic zero.
     
    450453seen as a surface in the real affine space with coordinates x,y,z.
    451454The format for the list varieties is not fully documented yet;
    452 please, see the examples below and try to adapt the examples to your needs.
     455please, see the examples below and try to adjust the examples to suit your needs.@*
     456The optional int parameter can be used to set plotting quality.
    453457
    454458ASSUME:
  • Singular/LIB/teachstd.lib

    r7de8e4 r1a3911  
    22//GMG, last modified 28.9.01
    33///////////////////////////////////////////////////////////////////////////////
    4 version="$Id: teachstd.lib,v 1.10 2009-02-12 13:57:00 motsak Exp $";
     4version="$Id: teachstd.lib,v 1.11 2009-04-06 12:39:02 seelisch Exp $";
    55category="Teaching";
    66info="
     
    7878{ "EXAMPLE:"; echo = 2;
    7979   ring s=0,(x,y,z),(c,dp);
    80    leadmonomial((y+z+x+xyz)**2);
    81    leadmonomial([(y+z+x+xyz)**2,xyz5]);
     80   leadmonomial((y+z+x+xyz)^2);
     81   leadmonomial([(y+z+x+xyz)^2,xyz5]);
    8282}
    8383///////////////////////////////////////////////////////////////////////////////
     
    226226proc minEcart(T,h)
    227227"USAGE:   minEcart(T,h); T ideal or module, h poly or vector
    228 RETURN:  element g from T such that leadmonom(g) divides leadmonom(h)
     228RETURN:  element g from T such that leadmonom(g) divides leadmonom(h)@*
    229229         ecart(g) is minimal with this property (if T != 0);
    230230         return 0 if T is 0 or h = 0
     
    413413RETURN:  1 if product criterion applies in the same module component,
    414414         2 if lead(f) and lead(g) involve different components, 0 else
    415 NOTE:    if product criterion applies we can delete (f,g) from pairset
     415NOTE:    if product criterion applies we can delete (f,g) from pairset.
    416416         This procedure returns 0 if o is given and is a positive integer, or
    417417         you may set the attribute \"default_arg\" for prodcrit to 1.
     
    500500RETURN:  list L,
    501501         L[1] = the pairset of G as list (not containing pairs for
    502          which the product or the chain criterion applies)
     502         which the product or the chain criterion applies),
    503503         L[2] = intvec v, v[1]= # product criterion, v[2]= # chain criterion
    504504EXAMPLE: example pairset; shows an example
     
    572572///////////////////////////////////////////////////////////////////////////////
    573573proc updatePairs(P,S,h)
    574 "USAGE:   updatePairs(P,S,h); P list, S ideal or module, h poly or vector
     574"USAGE:   updatePairs(P,S,h); P list, S ideal or module, h poly or vector@*
    575575         P a list of pairs of polys or vectors (obtained from pairset)
    576576RETURN:  list Q,
    577577         Q[1] = the pairset P enlarged  by all pairs (f,h), f from S,
    578          without pairs for which the product or the chain criterion applies
     578         without pairs for which the product or the chain criterion applies@*
    579579         Q[2] = intvec v, v[1]= # product criterion, v[2]= # chain criterion
    580580EXAMPLE: example updatePairs; shows an example
     
    745745///////////////////////////////////////////////////////////////////////////////
    746746proc localstd (id)
    747 "USAGE:   localstd (id); id = ideal
     747"USAGE:   localstd(id); id = ideal
    748748RETURN:  A standard basis for a local degree ordering, using Lazard's method.
    749749NOTE:    The procedure homogenizes id w.r.t. a new 1st variable local@t,
  • Singular/LIB/weierstr.lib

    r7de8e4 r1a3911  
    11//GMG, last modified 28.10.2001
    22///////////////////////////////////////////////////////////////////////////////
    3 version="$Id: weierstr.lib,v 1.5 2006-11-22 21:42:42 levandov Exp $";
     3version="$Id: weierstr.lib,v 1.6 2009-04-06 12:39:02 seelisch Exp $";
    44category="Teaching";
    55info="
     
    4949         say T; if not use the procedure lastvarGeneral first
    5050PURPOSE: perform the Weierstrass division of g by f up to order d
    51 RETURN:  a list, say l, of two polynomials and an interer, such that
    52                    g = l[1]*f + l[2],  deg_T(l[2]) < b
    53          up to (including) total degree d
    54          l[3] is the number of iterations used
    55          if f is not T-general, return (0,g)
     51RETURN:  - a list, say l, of two polynomials and an integer, such that@*
     52            g = l[1]*f + l[2],  deg_T(l[2]) < b, up to (including) total degree d@*
     53         - l[3] is the number of iterations used
     54         - if f is not T-general, return (0,g)
    5655NOTE:    the procedure works for any monomial ordering
    5756THEORY:  the proof of Grauert-Remmert (Analytische Stellenalgebren) is used
     
    143142         say T; if not apply the procedure lastvarGeneral first
    144143PURPOSE: perform the Weierstrass preparation of f up to order d
    145 RETURN:  a list, say l, of two polynomials and one integer,
     144RETURN:  - a list, say l, of two polynomials and one integer,
    146145         l[1] a unit, l[2] a Weierstrass polynomial, l[3] an integer
    147146         such that l[1]*f = l[2], where l[2] is a Weierstrass polynomial,
    148147         (i.e. l[2] = T^b + lower terms in T) up to (including) total degree d
    149          l[3] is the number of iterations used
    150          if f is not T-general, return (0,0)
     148         l[3] is the number of iterations used@*
     149         - if f is not T-general, return (0,0)
    151150NOTE:    the procedure works for any monomial ordering
    152151THEORY:  the proof of Grauert-Remmert (Analytische Stellenalgebren) is used
Note: See TracChangeset for help on using the changeset viewer.