Changeset 0bc582c in git


Ignore:
Timestamp:
Apr 6, 2009, 11:17:01 AM (14 years ago)
Author:
Frank Seelisch <seelisch@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
Children:
7de8e4cf4e88e60e523f5ebb65a61c114ff3674a
Parents:
bb9471e2e1af065ffce285ee2e4d142ab2d974b0
Message:
removed some docu bugs prior to release 3-1-0


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

Legend:

Unmodified
Added
Removed
  • Singular/LIB/graphics.lib

    rbb9471 r0bc582c  
    11//last change: 13.02.2001 (Eric Westenberger)
    22///////////////////////////////////////////////////////////////////////////////
    3 version="$Id: graphics.lib,v 1.12 2008-12-12 17:22:35 Singular Exp $";
     3version="$Id: graphics.lib,v 1.13 2009-04-06 09:17:01 seelisch Exp $";
    44category="Visualization";
    55info="
    6 LIBRARY: graphics.lib    Procedures to use Graphics with Mathematica
     6LIBRARY: graphics.lib    Procedures for graphical output using Mathematica
    77AUTHOR:   Christian Gorzel, gorzelc@math.uni-muenster.de
    88
     
    1515///////////////////////////////////////////////////////////////////////////////
    1616
    17 proc staircase(string fname,ideal I)
    18 "USAGE:   staircase(s,I); s a string, I ideal in two variables
     17proc staircase(ideal I)
     18"USAGE:   staircase(I); I an ideal in two variables
    1919RETURN:  string with Mathematica input for displaying staircase diagrams of an
    2020         ideal I, i.e. exponent vectors of the initial ideal of I
    21 NOTE:    ideal I should be given by a standard basis. Let s=\"\" and copy and
     21NOTE:    ideal I should be given by a standard basis. Copy and
    2222         paste the result into a Mathematica notebook.
    2323EXAMPLE: example staircase; shows an example
     
    6464  ring r0 = 0,(x,y),ls;
    6565  ideal I = -1x2y6-1x4y2, 7x6y5+1/2x7y4+6x4y6;
    66   staircase("",std(I));
     66  staircase(std(I));
    6767
    6868  ring r1 = 0,(x,y),dp;
    6969  ideal I = fetch(r0,I);
    70   staircase("",std(I));
     70  staircase(std(I));
    7171
    7272  ring r2 = 0,(x,y),wp(2,3);
    7373  ideal I = fetch(r0,I);
    74   staircase("",std(I));
     74  staircase(std(I));
    7575
    7676  // Paste the output into a Mathematica notebook
  • Singular/LIB/ntsolve.lib

    rbb9471 r0bc582c  
    11//(GMG, last modified 16.12.00)
    22///////////////////////////////////////////////////////////////////////////////
    3 version="$Id: ntsolve.lib,v 1.15 2006-07-18 15:48:29 Singular Exp $";
     3version="$Id: ntsolve.lib,v 1.16 2009-04-06 09:17:01 seelisch Exp $";
    44category="Symbolic-numerical solving";
    55info="
     
    2020  gls: contains the equations, for which a solution will be computed@*
    2121  ini: ideal of initial values (approximate solutions to start with),@*
    22   ipar: control integers (default: ipar = 100,10)
     22  ipar: control integers (default: ipar = [100, 10])
    2323  @format
    2424 ipar[1]: max. number of iterations
    25  ipar[2]: accuracy (we have the l_2-norm ||.||): accept solution @code{sol}
     25 ipar[2]: accuracy (we have the l_2-norm ||.||): accepts solution @code{sol}
    2626          if ||gls(sol)|| < eps0*(0.1^ipar[2])
    2727          where eps0 = ||gls(ini)|| is the initial error
     
    262262  a:   ideal of numbers, coordinates of an approximation of a common
    263263       zero of G to start with (with a[i] to be substituted in var(i)),@*
    264   ipar: control integer vector (default: ipar = 100,10)
     264  ipar: control integer vector (default: ipar = [100, 10])
    265265  @format
    266266  ipar[1]: max. number of iterations
    267267  ipar[2]: accuracy (we have as norm |.| absolute value ):
    268            accept solution @code{sol} if |G(sol)| < |G(a)|*(0.1^ipar[2]).
     268           accepts solution @code{sol} if |G(sol)| < |G(a)|*(0.1^ipar[2]).
    269269  @end format
    270270RETURN:  an ideal, coordinates of a better approximation of a zero of G
  • Singular/LIB/presolve.lib

    rbb9471 r0bc582c  
    11///////////////////////////////////////////////////////////////////////////////
    2 version="$Id: presolve.lib,v 1.28 2009-02-20 09:26:50 Singular Exp $";
     2version="$Id: presolve.lib,v 1.29 2009-04-06 09:17:01 seelisch Exp $";
    33category="Symbolic-numerical solving";
    44info="
     
    164164  @format
    165165  L[1]: ideal obtained from i by substituting from the first n variables those
    166         which appear in a linear part of i, by putting this part into triangular 
     166        which appear in a linear part of i, by putting this part into triangular
    167167        form
    168168  L[2]: ideal of variables which have been substituted
     
    326326            k[x(1..m)]/i -> k[..variables from [4]..]/[1]
    327327  @end format
    328 NOTE:    Applying elimpart to interred(i) may result in more sbstitutions.
     328NOTE:    Applying elimpart to interred(i) may result in more substitutions.
    329329         However, interred may be more expansive than elimpart for big ideals
    330330EXAMPLE: example elimpart; shows an example
     
    561561
    562562proc fastelim (ideal i, poly p, list #)
    563 "USAGE:   fastelim(i,p[h,o,a,b,e,m]); i=ideal, p=polynomial; h,o,a,b,e=integers
     563"USAGE:   fastelim(i,p[h,o,a,b,e,m]); i=ideal, p=polynomial; h,o,a,b,e=integers@*
    564564          p: product of variables to be eliminated;@*
    565565  Optional parameters:
     
    871871proc hilbvec (@id, list #)
    872872"USAGE:   hilbvec(id[,c,o]); id=poly/ideal/vector/module/matrix, c,o=strings,@*
    873           c=char, o=ordering used by @code{hilb}@*
    874           (default: c=\"32003\", o=\"dp\")
    875 RETURN:  intvec of 1-st Hilbert-series of id, computed in char c and ordering o
     873          c=char, o=ordering used by @code{hilb} (default: c=\"32003\", o=\"dp\")
     874RETURN:  intvec of 1st Hilbert-series of id, computed in char c and ordering o
    876875NOTE:    id must be homogeneous (i.e. all vars have weight 1)
    877876EXAMPLE: example hilbvec; shows an example
     
    969968
    970969proc solvelinearpart (id,list #)
    971 "USAGE:   solvelinearpart(id [,n] );  id=ideal/module, n=integer,@*
    972           (default: n=0)
     970"USAGE:   solvelinearpart(id [,n] );  id=ideal/module, n=integer (default: n=0)
    973971RETURN:  (interreduced) generators of id of degree <=1 in reduced triangular
    974972         form if n=0 [non-reduced triangular form if n!=0]
    975973ASSUME:  monomial ordering is a global ordering (p-ordering)
    976 NOTE:    may be used to solve a system of linear equations
     974NOTE:    may be used to solve a system of linear equations,
    977975         see @code{gauss_row} from 'matrix.lib' for a different method
    978976WARNING: the result is very likely to be false for 'real' coefficients, use
     
    10361034  - ni controls the sorting in i-th block (= vars occuring in pi):
    10371035    ni=0 (resp. ni!=0) means that least complex (resp. most complex) vars come
    1038     first @*
     1036    first
    10391037  - oi and mi define the monomial ordering of the i-th block:
    10401038    if mi =0, oi=ordstr(i-th block)
     
    11181116         id=poly/ideal/vector/module,@*
    11191117         p1,p2,...= polynomials (product of vars),@*
    1120          n1,n2,...=integers@*
     1118         n1,n2,...= integers@*
    11211119         (default: p1=product of all vars, n1=0)
    11221120         the last pi (containing the remaining vars) may be omitted
     
    11281126       ni=0 (resp. ni!=0) means that less (resp. more) complex vars come first
    11291127  [2]: a list with 4 entries for each pi:
    1130        ideal ai : vars of pi in correct order,
    1131        intvec vi: permutation vector describing the ordering in ai,
    1132        intmat Mi: valuation matrix of ai, the columns of Mi being the
     1128       _[1]: ideal ai : vars of pi in correct order,
     1129       _[2]: intvec vi: permutation vector describing the ordering in ai,
     1130       _[3]: intmat Mi: valuation matrix of ai, the columns of Mi being the
    11331131                  valuation vectors of the vars in ai
    1134        intvec wi: size of 1-st, 2-nd,... block of identical columns of Mi
     1132       _[4]: intvec wi: size of 1-st, 2-nd,... block of identical columns of Mi
    11351133                  (vars with same valuation)
    11361134  @end format
     
    11831181
    11841182         ni controls the ordering of vars occuring in pi: ni=0 (resp. ni!=0)
    1185          means that less (resp. more) complex vars come first@*
    1186          (default: p1=product of all vars, n1=0)
     1183         means that less (resp. more) complex vars come first (default: p1=product of all vars, n1=0),@*
    11871184         the last pi (containing the remaining vars) may be omitted
    11881185COMPUTE: valuation (complexity) of variables with respect to id.@*
  • Singular/LIB/ring.lib

    rbb9471 r0bc582c  
    11///////////////////////////////////////////////////////////////////////////////
    2 version="$Id: ring.lib,v 1.32 2008-03-25 15:20:08 Singular Exp $";
     2version="$Id: ring.lib,v 1.33 2009-04-06 09:17:01 seelisch Exp $";
    33category="General purpose";
    44info="
     
    279279            If, however, a and b are local to a proc calling extendring, the
    280280            intvec iv must be used to let extendring know the values of a and b
    281 @*        -  If an intvec iv !=0 is given, iv[1],iv[2],... is taken for the
     281@*        -  If a non-zero intvec iv is given, iv[1],iv[2],... are taken for the
    282282            1st, 2nd,... block of o, if o contains no substring \"w\" or \"W\"
    283283            i.e. no weighted ordering (in the above case o=\"ds,dp,ls\"
     
    286286            allowed) iv[1] is taken as size for the weight-vector, the next
    287287            iv[1] values of iv are taken as weights and the remaining values of
    288             iv as block-size for the remaining non-weighted blocks.
     288            iv as block size for the remaining non-weighted blocks.
    289289            e.g. o=\"dp,ws,Dp,ds\", iv=3,2,3,4,2,5 creates the ordering
    290290            dp(2),ws(2,3,4),Dp(5),ds
     
    416416proc fetchall (R, list #)
    417417"USAGE:   fetchall(R[,s]);  R=ring/qring, s=string
    418 CREATE:  fetch all objects of ring R (of type poly/ideal/vector/module/number/
    419          matrix) into the basering.
     418CREATE:  fetch all objects of ring R (of type poly/ideal/vector/module/number/matrix)
     419         into the basering.
    420420         If no 2nd argument is present, the names are the same as in R. If,
    421421         say, f is a poly in R and the 2nd argument is the string \"R\", then f
    422          is maped to f_R etc.
     422         is mapped to f_R etc.
    423423RETURN:  no return value
    424424NOTE:    As fetch, this procedure maps the 1st, 2nd, ... variable of R to the
     
    462462proc imapall (R, list #)
    463463"USAGE:   imapall(R[,s]);  R=ring/qring, s=string
    464 CREATE:  map all objects of ring R (of type poly/ideal/vector/module/number/
    465          matrix) into the basering, by applying imap to all objects of R.
     464CREATE:  map all objects of ring R (of type poly/ideal/vector/module/number/matrix)
     465         into the basering by applying imap to all objects of R.
    466466         If no 2nd argument is present, the names are the same as in R. If,
    467467         say, f is a poly in R and the 3rd argument is the string \"R\", then f
    468          is maped to f_R etc.
     468         is mapped to f_R etc.
    469469RETURN:  no return value
    470470NOTE:    As imap, this procedure maps the variables of R to the variables with
    471          the same name in the basering, the other variables are maped to 0.
     471         the same name in the basering, the other variables are mapped to 0.
    472472         The 2nd argument is useful in order to avoid conflicts of names, the
    473473         empty string is allowed
     
    509509"USAGE:   mapall(R,i[,s]);  R=ring/qring, i=ideal of basering, s=string
    510510CREATE:  map all objects of ring R (of type poly/ideal/vector/module/number/
    511          matrix, map) into the basering, by mapping the jth variable of R to
    512          the jth generator of the ideal i. If no 3rd argument is present, the
     511         matrix, map) into the basering by mapping the j-th variable of R to
     512         the j-th generator of the ideal i. If no 3rd argument is present, the
    513513         names are the same as in R. If, say, f is a poly in R and the 3rd
    514          argument is the string \"R\", then f is maped to f_R etc.
     514         argument is the string \"R\", then f is mapped to f_R etc.
    515515RETURN:  no return value.
    516516NOTE:    This procedure has the same effect as defining a map, say psi, by
     
    549549//   j; print(M); phi;    //phi maps R to S: x->c2, y->a2, z->b2
    550550//   ideal i1=a2,a+b,1;
    551 //   mapall(R,i1,\"\");   //map from R to S: x->a2, y->a+b, z->1
     551//   mapall(R,i1,\"\");     //map from R to S: x->a2, y->a+b, z->1
    552552//   names(S);
    553553//   j_; print(M_); phi_;
    554554//   changevar(\"T\",\"x()\",R);  //change vars in R and call result T
    555 //   mapall(R,maxideal(1));       //identity map from R to T
     555//   mapall(R,maxideal(1));   //identity map from R to T
    556556//   names(T);
    557557//   j; print(M); phi;
     
    645645   def S=changevar("x,y,z");       //change vars of s
    646646   setring S;
    647    qring qS =std(fetch(s,i));      //create qring of S mod i (maped to S)
     647   qring qS =std(fetch(s,i));      //create qring of S mod i (mapped to S)
    648648   def T=changevar("d,e,f,g,h",t); //change vars of t
    649649   setring T;
     
    687687        all input parameters of type string
    688688RETURN:  ideal
    689 PURPOSE: computes the preimage of an ideal under a given map for non-global
     689PURPOSE: compute the preimage of an ideal under a given map for non-global
    690690         orderings.
    691          The second argument has to be the name of a map from the basering to
     691         The 2nd argument has to be the name of a map from the basering to
    692692         the given ring (or the name of an ideal defining such a map), and
    693693         the ideal has to be an ideal in the given ring.
  • Singular/LIB/signcond.lib

    rbb9471 r0bc582c  
    1 // $Id: signcond.lib,v 1.7 2006-07-18 15:48:30 Singular Exp $
     1// $Id: signcond.lib,v 1.8 2009-04-06 09:17:01 seelisch Exp $
    22// E. Tobis  12.Nov.2004
    33// last change 5. May 2005 (G.-M. Greuel)
     
    2626
    2727proc firstoct(ideal I)
    28 "USAGE:    firstoct(i); i ideal
    29 RETURN:   number: the number of points of V(i) lying in the first octant
    30 ASSUME:   i is a Groebner basis
     28"USAGE:    firstoct(I); I ideal
     29RETURN:   number: the number of points of V(I) lying in the first octant
     30ASSUME:   I is given by a Groebner basis.
    3131SEE ALSO: signcnd
    3232EXAMPLE:  example firstoct; shows an example"
     
    8080           give rise to the sign condition expressed by the same position on
    8181           the first list.
    82            See the example for further explanation of the output.
    83 ASSUME:    I is a Groebner basis
    84 NOTE:      The procedure psigncnd performs some pretty printing of this output
     82           See the example for further explanations of the output.
     83ASSUME:    I is a Groebner basis.
     84NOTE:      The procedure psigncnd performs some pretty printing of this output.
    8585SEE ALSO:  firstoct, psigncnd
    8686EXAMPLE:   example signcnd; shows an example"
  • Singular/LIB/solve.lib

    rbb9471 r0bc582c  
    11///////////////////////////////////////////////////////////////////////////////
    2 version="$Id: solve.lib,v 1.37 2009-01-06 14:15:21 Singular Exp $";
     2version="$Id: solve.lib,v 1.38 2009-04-06 09:17:01 seelisch Exp $";
    33category="Symbolic-numerical solving";
    44info="
     
    2828proc laguerre_solve( poly f, list # )
    2929"USAGE:   laguerre_solve(f [, m, l, n, s] ); f = polynomial,@*
    30          m, l, n, s = integers (control parameters of the method)
     30         m, l, n, s = integers (control parameters of the method)@*
    3131 m: precision of output in digits ( 4 <= m), if basering is not ring of
    3232      complex numbers;
    3333 l: precision of internal computation in decimal digits ( l >=8 )
    34       only if the basering is not complex or complex with smaller precision;
     34      only if the basering is not complex or complex with smaller precision;@*
    3535 n: control of multiplicity of roots or of splitting of f into
    3636      squarefree factors
     
    202202      {
    203203        if(charstr(rn)=="0"){dbprint(prot,"// polynomial is squarefree");}
    204         else{dbprint(prot,"// split without result");}
     204        else{dbprint(prot,"//split without result");}
    205205      }
    206206    }
     
    517517proc solve( ideal G, list # )
    518518"USAGE:   solve(G [, m, n [, l]] [,\"oldring\"] [,\"nodisplay\"] ); G = ideal,
    519          m, n, l = integers (control parameters of the method), outR ring
     519         m, n, l = integers (control parameters of the method), outR ring,@*
    520520         m: precision of output in digits ( 4 <= m) and of the generated ring
    521521            of complex numbers;
     
    14761476proc mp_res_mat( ideal i, list # )
    14771477"USAGE:   mp_res_mat(i [, k] ); i ideal, k integer,
    1478     k=0: sparse resultant matrix of Gelfand, Kapranov and Zelevinsky,
     1478    k=0: sparse resultant matrix of Gelfand, Kapranov and Zelevinsky,@*
    14791479    k=1: resultant matrix of Macaulay (k=0 is default)
    14801480ASSUME:  The number of elements in the input system must be the number of
     
    20432043proc triang_solve( list lfi, int prec, list # )
    20442044"USAGE:   triang_solve(l,p [,d] ); l=list, p,d=integers@*
    2045          l a list of finitely many triangular systems, such that the union of
     2045         l is a list of finitely many triangular systems, such that the union of
    20462046         their varieties equals the variety of the initial ideal.@*
    20472047         p>0: gives precision of complex numbers in digits,@*
  • Singular/LIB/triang.lib

    rbb9471 r0bc582c  
    11//last change: 13.02.2001 (Eric Westenberger)
    22//////////////////////////////////////////////////////////////////////////////
    3 version="$Id: triang.lib,v 1.12 2008-10-01 14:20:22 Singular Exp $";
     3version="$Id: triang.lib,v 1.13 2009-04-06 09:17:01 seelisch Exp $";
    44category="Symbolic-numerical solving";
    55info="
     
    629629         If i = 2, then each polynomial of the triangular systems
    630630         is factorized.
    631 NOTE:    Algorithm of Moeller (see: Moeller, H.M.:
    632          On decomposing systems of polynomial equations with
    633          finitely many solutions, Appl. Algebra Eng. Commun. Comput. 4,
    634          217 - 230, 1993).
     631NOTE:    Algorithm of Moeller (see: Moeller, H.M.: On decomposing systems of
     632         polynomial equations with finitely many solutions, Appl. Algebra Eng.
     633         Commun. Comput. 4, 217 - 230, 1993).
    635634EXAMPLE: example triangM; shows an example
    636635"
  • Singular/LIB/zeroset.lib

    rbb9471 r0bc582c  
    11// Last change 12.02.2001 (Eric Westenberger)
    22///////////////////////////////////////////////////////////////////////////////
    3 version="$Id: zeroset.lib,v 1.18 2008-10-09 09:31:58 Singular Exp $";
     3version="$Id: zeroset.lib,v 1.19 2009-04-06 09:17:01 seelisch Exp $";
    44category="Symbolic-numerical solving";
    55info="
    6 LIBRARY:  zeroset.lib      Procedures For Roots and Factorization
    7 AUTHOR:   Thomas Bayer,    email: tbayer@mathematik.uni-kl.de
    8           http://wwwmayr.informatik.tu-muenchen.de/personen/bayert/
    9           Current Address: Institut fuer Informatik, TU Muenchen
     6LIBRARY:  zeroset.lib      Procedures for roots and factorization
     7AUTHOR:   Thomas Bayer,    email: tbayer@mathematik.uni-kl.de,@*
     8          http://wwwmayr.informatik.tu-muenchen.de/personen/bayert/@*
     9          Current address: Hochschule Ravensburg-Weingarten
    1010
    1111OVERVIEW:
     
    1818 of Singular for univariate factorization of polynomials over simple algebraic
    1919 extensions in characteristic 0.
     20 
     21 NOTE:
    2022 Subprocedures with postfix 'Main' require that the ring contains a variable
    2123 'a' and no parameters, and the ideal 'mpoly', where 'minpoly' from the
     
    2325
    2426PROCEDURES:
    25  Quotient(f, g)    quotient q  of f w.r.t. g (in f = q*g + remainder)
    26  Remainder(f,g)    remainder of the division of f by g
    27  Roots(f)    computes all roots of f in an extension field of Q
    28  SQFRNorm(f)    norm of f (f must be squarefree)
    29  ZeroSet(I)    zero-set of the 0-dim. ideal I
     27 quotient(f, g)    quotient q  of f w.r.t. g (in f = q*g + remainder)
     28 remainder(f,g)    remainder of the division of f by g
     29 roots(f)    computes all roots of f in an extension field of Q
     30 sqfrNorm(f)    norm of f (f must be squarefree)
     31 zeroSet(I)    zero-set of the 0-dim. ideal I
    3032
    3133AUXILIARY PROCEDURES:
    32  EGCDMain(f, g)    gcd over an algebraic extension field of Q
    33  FactorMain(f)    factorization of f over an algebraic extension field
    34  InvertNumberMain(c)  inverts an element of an algebraic extension field
    35  QuotientMain(f, g)  quotient of f w.r.t. g
    36  RemainderMain(f,g)  remainder of the division of f by g
    37  RootsMain(f)    computes all roots of f, might extend the ground field
    38  SQFRNormMain(f)  norm of f (f must be squarefree)
    39  ContainedQ(data, f)  f in data ?
    40  SameQ(a, b)    a == b (list a,b)
     34 egcdMain(f, g)    gcd over an algebraic extension field of Q
     35 factorMain(f)    factorization of f over an algebraic extension field
     36 invertNumberMain(c)  inverts an element of an algebraic extension field
     37 quotientMain(f, g)  quotient of f w.r.t. g
     38 remainderMain(f,g)  remainder of the division of f by g
     39 rootsMain(f)    computes all roots of f, might extend the ground field
     40 sqfrNormMain(f)  norm of f (f must be squarefree)
     41 containedQ(data, f)  f in data ?
     42 sameQ(a, b)    a == b (list a,b)
    4143";
    4244
     
    5759
    5860// Improvement :
    59 // a main problem is the growth of the coefficients. Try Roots(x7 - 1)
     61// a main problem is the growth of the coefficients. Try roots(x7 - 1)
    6062// return ideal mpoly !
    6163// mpoly is not monic, comes from primitive_extra
     
    7577///////////////////////////////////////////////////////////////////////////////
    7678
    77 proc Roots(poly f)
    78 "USAGE:   Roots(f); where f is a polynomial
     79proc roots(poly f)
     80"USAGE:   roots(f); where f is a polynomial
    7981PURPOSE: compute all roots of f in a finite extension of the ground field
    8082         without multiplicities.
     
    9193  @end format
    9294ASSUME:  ground field to be Q or a simple extension of Q given by a minpoly
    93 EXAMPLE: example  Roots; shows an example
     95EXAMPLE: example  roots; shows an example
    9496"
    9597{
     
    108110
    109111  poly f = imap(ROB, f);
    110   list result = RootsMain(f);  // find roots of f
     112  list result = rootsMain(f);  // find roots of f
    111113
    112114  // store the roots and the new representation of 'a' and transform
     
    130132  export(newA);
    131133  export(f); dbprint(dbPrt,"
    132 // 'Roots' created a new ring which contains the list 'roots' and
     134// 'roots' created a new ring which contains the list 'roots' and
    133135// the polynomials 'f' and 'newA'
    134136// To access the roots, newA and the new representation of f, type
    135    def R = Roots(f); setring R; roots; newA; f;
     137   def R = roots(f); setring R; roots; newA; f;
    136138");
    137139  return(RON);
     
    142144  minpoly = a2+1;
    143145  poly f = x3 - a;
    144   def R1 = Roots(f);
     146  def R1 = roots(f);
    145147  setring R1;
    146148  minpoly;
     
    155157///////////////////////////////////////////////////////////////////////////////
    156158
    157 proc RootsMain(poly f)
    158 "USAGE:   RootsMain(f); where f is a polynomial
     159proc rootsMain(poly f)
     160"USAGE:   rootsMain(f); where f is a polynomial
    159161PURPOSE: compute all roots of f in a finite extension of the ground field
    160162         without multiplicities.
     
    162164  @format
    163165  _[1] = roots of f, each entry is a polynomial
    164   _[2] = 'newA' - if the ground field is Q(a') and the extension field
    165          is Q(a), then 'newA' is the representation of a' in Q(a)
     166  _[2] = 'newA' - if the ground field is Q(b) and the extension field
     167         is Q(a), then 'newA' is the representation of b in Q(a)
    166168  _[3] = minpoly of the algebraic extension of the ground field
    167169  @end format
    168170ASSUME:  basering = Q[x,a] ideal mpoly must be defined, it might be 0!
    169171NOTE:    might change the ideal mpoly!!
    170 EXAMPLE: example  Roots; shows an example
     172EXAMPLE: example  roots; shows an example
    171173"
    172174{
     
    182184  // nonlinear factors are processed later
    183185
    184   dbprint(dbPrt, "Roots of " + string(f) +  ", minimal polynomial = " + string(mpoly[1]));
    185   factorList = FactorMain(f);          // Factorize f
     186  dbprint(dbPrt, "roots of " + string(f) +  ", minimal polynomial = " + string(mpoly[1]));
     187  factorList = factorMain(f);          // Factorize f
    186188  dbprint(dbPrt, (" prime factors of f are : " + string(factorList[1])));
    187189
     
    193195      linFactors++;        // get the root from the linear factor
    194196      lc = LeadTerm(fa, 1)[3];
    195       fa = MultPolys(InvertNumberMain(lc), fa); // make factor monic
     197      fa = MultPolys(invertNumberMain(lc), fa); // make factor monic
    196198      roots[linFactors] = var(1) - fa;  // fa is monic !!
    197199    }
     
    227229    // compute the roots of the nonlinear (irreducible, monic) factor f1 of f
    228230    // by extending the basefield by a' with minimal polynomial f1
    229     // Then call Roots(f1) to find the roots of f1 over the new base field
     231    // Then call roots(f1) to find the roots of f1 over the new base field
    230232
    231233    f1 = nlFactors[1];
     
    247249    result[3] = mpoly[1];
    248250    oldMinPoly = mpoly[1];
    249     partSol = RootsMain(f1);    // find roots of f1 over extended field
     251    partSol = rootsMain(f1);    // find roots of f1 over extended field
    250252
    251253    if(oldMinPoly != partSol[3]) {    // minpoly has changed ?
     
    262264  }
    263265  else {  // more than one nonlinear (irreducible) factor (f_1,...,f_r)
    264     // solve each of them by RootsMain(f_i), append their roots
     266    // solve each of them by rootsMain(f_i), append their roots
    265267    // change the minpoly and transform all previously computed
    266268    // roots if necessary.
     
    271273    for(i = 1; i <= size(nlFactors); i = i + 1) {
    272274      oldMinPoly = mpoly[1];
    273       partSol = RootsMain(nlFactors[i]);    // main work
     275      partSol = rootsMain(nlFactors[i]);    // main work
    274276      nlFactors[i] = 0;        // delete factor
    275277      result[3] = partSol[3];        // store minpoly
     
    297299///////////////////////////////////////////////////////////////////////////////
    298300
    299 proc ZeroSet(ideal I, list #)
    300 "USAGE:   ZeroSet(I [,opt] ); I=ideal, opt=integer
     301proc zeroSet(ideal I, list #)
     302"USAGE:   zeroSet(I [,opt] ); I=ideal, opt=integer
    301303PURPOSE: compute the zero-set of the zero-dim. ideal I, in a finite extension
    302304         of the ground field.
     
    306308  @format
    307309  - 'zeroset' is the list of the zeros of the ideal I, each zero is an ideal.
    308   - if the ground field is Q(a') and the extension field is Q(a), then
    309     'newA' is the representation of a' in Q(a).
     310  - if the ground field is Q(b) and the extension field is Q(a), then
     311    'newA' is the representation of b in Q(a).
    310312    If the basering contains a parameter 'a' and the minpoly remains unchanged
    311313    then 'newA' = 'a'.
     
    315317ASSUME:  dim(I) = 0, and ground field to be Q or a simple extension of Q given
    316318         by a minpoly.
    317 OPTIONS: opt = 0 no primary decomposition (default)
    318          opt > 0 primary decomposition
    319 NOTE:    If I contains an algebraic number (parameter) then 'I' must be
     319OPTIONS: opt = 0: no primary decomposition (default)
     320         opt > 0: primary decomposition
     321NOTE:    If I contains an algebraic number (parameter) then I must be
    320322         transformed w.r.t. 'newA' in the new ring.
    321 EXAMPLE: example ZeroSet; shows an example
     323EXAMPLE: example zeroSet; shows an example
    322324"
    323325{
     
    347349  }
    348350
    349   list result = ZeroSetMain(id, primaryDecQ);
     351  list result = zeroSetMain(id, primaryDecQ);
    350352
    351353  // store the zero-set, minimal polynomial and the new representative of 'a'
     
    376378  export(newA);
    377379    dbprint(dbPrt,"
    378 // 'ZeroSet' created a new ring which contains the list 'zeroset', the ideal
     380// 'zeroSet' created a new ring which contains the list 'zeroset', the ideal
    379381// 'id' and the polynomial 'newA'. 'id' is the ideal of the input transformed
    380382// w.r.t. 'newA'.
    381383// To access the zero-set, 'newA' and the new representation of the ideal, type
    382    def R = ZeroSet(I); setring R; zeroset; newA; id;
     384   def R = zeroSet(I); setring R; zeroset; newA; id;
    383385");
    384386  setring RZSB;
     
    390392  minpoly = a2 + 1;
    391393  ideal I = x2 - 1/2, a*z - 1, y - 2;
    392   def T = ZeroSet(I);
     394  def T = zeroSet(I);
    393395  setring T;
    394396  minpoly;
     
    404406///////////////////////////////////////////////////////////////////////////////
    405407
    406 proc InvertNumberMain(poly f)
    407 "USAGE:   InvertNumberMain(f); where f is a polynomial
     408proc invertNumberMain(poly f)
     409"USAGE:   invertNumberMain(f); where f is a polynomial
    408410PURPOSE: compute 1/f if f is a number in Q(a), i.e., f is represented by a
    409411         polynomial in Q[a].
     
    468470///////////////////////////////////////////////////////////////////////////////
    469471
    470 proc Quotient(poly f, poly g)
    471 "USAGE:   Quotient(f, g); where f,g are polynomials;
     472proc quotient(poly f, poly g)
     473"USAGE:   quotient(f, g); where f,g are polynomials;
    472474PURPOSE: compute the quotient q and remainder r s.t. f = g*q + r, deg(r) < deg(g)
    473475RETURN:  list of polynomials
     
    478480ASSUME:  basering = Q[x] or Q(a)[x]
    479481NOTE: outdated, use div/mod instead
    480 EXAMPLE: example  Quotient; shows an example
     482EXAMPLE: example  quotient; shows an example
    481483"
    482484{
     
    487489  poly f = imap(QUOB, f);
    488490  poly g = imap(QUOB, g);
    489   list result = QuotientMain(f, g);
     491  list result = quotientMain(f, g);
    490492
    491493  setring(QUOB);
     
    500502 poly f =  x4 - 2;
    501503 poly g = x - a;
    502  list qr = Quotient(f, g);
     504 list qr = quotient(f, g);
    503505 qr;
    504506 qr[1]*g + qr[2] - f;
    505507}
    506508
    507 proc QuotientMain(poly f, poly g)
    508 "USAGE:   QuotientMain(f, g); where f,g are polynomials
     509proc quotientMain(poly f, poly g)
     510"USAGE:   quotientMain(f, g); where f,g are polynomials
    509511PURPOSE: compute the quotient q and remainder r s.th. f = g*q + r, deg(r) < deg(g)
    510512RETURN:  list of polynomials
     
    516518         this represents the ring Q(a)[x] together with its minimal polynomial.
    517519NOTE: outdated, use div/mod instead
    518 EXAMPLE: example  Quotient; shows an example
     520EXAMPLE: example  quotient; shows an example
    519521"
    520522{
     
    532534///////////////////////////////////////////////////////////////////////////////
    533535
    534 proc Remainder(poly f, poly g)
    535 "USAGE:   Remainder(f, g); where f,g are polynomials
     536proc remainder(poly f, poly g)
     537"USAGE:   remainder(f, g); where f,g are polynomials
    536538PURPOSE: compute the remainder of the division of f by g, i.e. a polynomial r
    537539         s.t. f = g*q + r, deg(r) < deg(g).
     
    547549  poly f = imap(REMB, f);
    548550  poly g = imap(REMB, g);
    549   poly h = RemainderMain(f, g);
     551  poly h = remainderMain(f, g);
    550552
    551553  setring(REMB);
     
    560562 poly f =  x4 - 1;
    561563 poly g = x3 - 1;
    562  Remainder(f, g);
    563 }
    564 
    565 proc RemainderMain(poly f, poly g)
    566 "USAGE:   RemainderMain(f, g); where f,g are polynomials
     564 remainder(f, g);
     565}
     566
     567proc remainderMain(poly f, poly g)
     568"USAGE:   remainderMain(f, g); where f,g are polynomials
    567569PURPOSE: compute the remainder r s.t. f = g*q + r, deg(r) < deg(g)
    568570RETURN:  poly
     
    579581
    580582  lc = LeadTerm(g, 1)[3];
    581   g1 = MultPolys(InvertNumberMain(lc), g);  // make g monic
     583  g1 = MultPolys(invertNumberMain(lc), g);  // make g monic
    582584
    583585  return(SimplifyPoly(reduce(f, std(g1))));
     
    586588///////////////////////////////////////////////////////////////////////////////
    587589
    588 proc EGCDMain(poly f, poly g)
    589 "USAGE:   EGCDMain(f, g); where f,g are polynomials
     590proc egcdMain(poly f, poly g)
     591"USAGE:   egcdMain(f, g); where f,g are polynomials
    590592PURPOSE: compute the polynomial gcd of f and g over Q(a)[x]
    591593RETURN:  poly
     
    604606
    605607  while(r2 != 0) {
    606     r  = RemainderMain(r1, r2);
     608    r  = remainderMain(r1, r2);
    607609    r1 = r2;
    608610    r2 = r;
     
    648650///////////////////////////////////////////////////////////////////////////////
    649651
    650 proc SQFRNorm(poly f)
    651 "USAGE:   SQFRNorm(f); where f is a polynomial
     652proc sqfrNorm(poly f)
     653"USAGE:   sqfrNorm(f); where f is a polynomial
    652654PURPOSE: compute the norm of the squarefree polynomial f in Q(a)[x].
    653655RETURN:  list with 3 entries
     
    659661ASSUME:  f must be squarefree, basering = Q(a)[x] and minpoly != 0.
    660662NOTE:    the norm is an element of Q[x]
    661 EXAMPLE: example  SQFRNorm; shows an example
     663EXAMPLE: example  sqfrNorm; shows an example
    662664"
    663665{
     
    667669  setring SNR;
    668670  poly f = imap(SNB, f);
    669   list result = SQFRNormMain(f);  // squarefree norm of f
     671  list result = sqfrNormMain(f);  // squarefree norm of f
    670672
    671673  setring SNB;
     
    679681   minpoly = a2+1;
    680682  poly f =  x4 - 2*x + 1;
    681   SQFRNorm(f);
    682 }
    683 
    684 proc SQFRNormMain(poly f)
    685 "USAGE:   SQFRNorm(f); where f is a polynomial
     683  sqfrNorm(f);
     684}
     685
     686proc sqfrNormMain(poly f)
     687"USAGE:   sqfrNorm(f); where f is a polynomial
    686688PURPOSE: compute the norm of the squarefree polynomial f in Q(a)[x].
    687689RETURN:  list with 3 entries
     
    734736///////////////////////////////////////////////////////////////////////////////
    735737
    736 proc FactorMain(poly f)
    737 "USAGE:   FactorMain(f); where f is a polynomial
     738proc factorMain(poly f)
     739"USAGE:   factorMain(f); where f is a polynomial
    738740PURPOSE: compute the factorization of the squarefree poly f over Q(a)[t],
    739741         minpoly  = p(a).
     
    771773  fac1[1] = 1;
    772774  fac2[1] = 1;
    773   normList = SQFRNormMain(f);
     775  normList = sqfrNormMain(f);
    774776  // print(" factorize : deg = " + string(deg(normList[1], intvec(1,0))));
    775777  factorList = factorize(normList[1]);     // factor squarefree norm of f over Q[x]
     
    782784  for(i = 2; i <= size(factorList[1]); i = i + 1) {
    783785    H = factorList[1][i];
    784     h = EGCDMain(H, g);
    785     quo_rem = QuotientMain(g, h);
     786    h = egcdMain(H, g);
     787    quo_rem = quotientMain(g, h);
    786788    g = quo_rem[1];
    787789    fac1[i] = SimplifyPoly(F(h));
     
    793795///////////////////////////////////////////////////////////////////////////////
    794796
    795 proc ZeroSetMain(ideal I, int primDecQ)
    796 "USAGE:   ZeroSetMain(ideal I, int opt); ideal I, int opt
     797proc zeroSetMain(ideal I, int primDecQ)
     798"USAGE:   zeroSetMain(ideal I, int opt); ideal I, int opt
    797799PURPOSE: compute the zero-set of the zero-dim. ideal I, in a simple extension
    798800         of the ground field.
     
    812814NOTE:    opt = 0  no primary decomposition
    813815         opt > 0  use a primary decomposition
    814 EXAMPLE: example ZeroSet; shows an example
    815 "
    816 {
    817   // main work is done in ZeroSetMainWork, here the zero-set of each ideal from the
    818   // primary decompostion is coputed by menas of ZeroSetMainWork, and then the
     816EXAMPLE: example zeroSet; shows an example
     817"
     818{
     819  // main work is done in zeroSetMainWork, here the zero-set of each ideal from the
     820  // primary decompostion is coputed by menas of zeroSetMainWork, and then the
    819821  // minpoly and the parameter representing the algebraic extension are
    820822  // transformed according to 'newA', i.e., only bookeeping is done.
     
    829831
    830832  dbPrt = printlevel-voice+2;
    831   dbprint(dbPrt, "ZeroSet of " + string(I) + ", minpoly = " + string(minpoly));
     833  dbprint(dbPrt, "zeroSet of " + string(I) + ", minpoly = " + string(minpoly));
    832834
    833835  n = nvars(basering) - 1;
     
    835837  w[n + 1] = 0;
    836838
    837   if(primDecQ == 0) { return(ZeroSetMainWork(I, w, 0)); }
     839  if(primDecQ == 0) { return(zeroSetMainWork(I, w, 0)); }
    838840
    839841  newA = var(n + 1);
     
    862864    oldMinPoly = mpoly[1];
    863865    dbprint(dbPrt, " ideal#" + string(i) + " of " + string(size(idealList)) + " = " + string(J));
    864     currentSol = ZeroSetMainWork(J, w, 0);
     866    currentSol = zeroSetMainWork(J, w, 0);
    865867
    866868    if(oldMinPoly != currentSol[3]) {   // change minpoly and transform solutions
     
    883885///////////////////////////////////////////////////////////////////////////////
    884886
    885 proc ZeroSetMainWork(ideal id, intvec wt, int sVars)
    886 "USAGE:   ZeroSetMainWork(I, wt, sVars);
     887proc zeroSetMainWork(ideal id, intvec wt, int sVars)
     888"USAGE:   zeroSetMainWork(I, wt, sVars);
    887889PURPOSE: compute the zero-set of the zero-dim. ideal I, in a finite extension
    888890         of the ground field (without multiplicities).
     
    958960  // substitute each partial solution in generators and find the
    959961  // zero set of the resulting ideal by recursive application
    960   // of ZeroSetMainWork !
     962  // of zeroSetMainWork !
    961963
    962964  index = linIndex + nlinIndex;
     
    968970    gens = std(SimplifyData(Fsubs(generators)));    // substitute partial solution
    969971    oldMinPoly = mpoly[1];
    970     partSol = ZeroSetMainWork(gens, wt, size(index) + sVars);
     972    partSol = zeroSetMainWork(gens, wt, size(index) + sVars);
    971973
    972974    if(oldMinPoly != partSol[3]) {    // minpoly has changed
     
    10281030        nrSols++; found++;
    10291031        index[nrSols] = vars[1];
    1030         sol[nrSols] = var(vars[1]) - MultPolys(InvertNumberMain(LeadTerm(f, vars[1])[3]), f);
     1032        sol[nrSols] = var(vars[1]) - MultPolys(invertNumberMain(LeadTerm(f, vars[1])[3]), f);
    10311033      }
    10321034    }
     
    10501052
    10511053proc NonLinearZeroSetMain(ideal I, intvec wt)
    1052 "USAGE:   ZeroSetMainWork(I, wt, sVars);
     1054"USAGE:   NonLinearZeroSetMain(I, wt);
    10531055PURPOSE: solves the (nonlinear) univariate polynomials in I
    10541056         of the ground field (without multiplicities).
     
    11031105      export(RIS1);
    11041106      export(mpoly);
    1105       roots = RootsMain(f);
     1107      roots = rootsMain(f);
    11061108
    11071109      // get "old" basering with new minpoly
     
    11801182         'sol2' is a list of partial solutions (from 'NonLinearZeroSetMain')
    11811183ASSUME:  'sol2' is not empty
    1182 NOTE:    used by 'ZeroSetMainWork'
     1184NOTE:    used by 'zeroSetMainWork'
    11831185{
    11841186  int i, j, k, m;
     
    12111213  ideal I;
    12121214  for(int i = 1; i <= nvars(basering) - 1; i = i + 1) {    // built subs. map
    1213     if(ContainedQ(index, i)) {
     1215    if(containedQ(index, i)) {
    12141216      k++;
    12151217      I[index[k]] = sol[k];
     
    12661268///////////////////////////////////////////////////////////////////////////////
    12671269
    1268 proc ContainedQ(data, f, list #)
    1269 "USAGE:    ContainedQ(data, f [, opt]); data=list; f=any type, opt=integer
     1270proc containedQ(data, f, list #)
     1271"USAGE:    containedQ(data, f [, opt]); data=list; f=any type; opt=integer
    12701272PURPOSE:  test if f is an element of data.
    12711273RETURN:   int
     
    12731275          1 if f contained in data
    12741276OPTIONS:  opt = 0 : use '==' for comparing f with elements from data@*
    1275           opt = 1 : use @code{SameQ} for comparing f with elements from data
     1277          opt = 1 : use @code{sameQ} for comparing f with elements from data
    12761278"
    12771279{
     
    12881290    }
    12891291    else {
    1290       if(SameQ(f, data[i])) { found = 1;}
     1292      if(sameQ(f, data[i])) { found = 1;}
    12911293      else {i = i + 1;}
    12921294    }
     
    12971299//////////////////////////////////////////////////////////////////////////////
    12981300
    1299 proc SameQ(a, b)
    1300 "USAGE:    SameQ(a, b); a,b=list/intvec
     1301proc sameQ(a, b)
     1302"USAGE:    sameQ(a, b); a,b=list/intvec
    13011303PURPOSE:  test a == b elementwise, i.e., a[i] = b[i].
    13021304RETURN:   int
Note: See TracChangeset for help on using the changeset viewer.