Changeset bb17e8 in git


Ignore:
Timestamp:
Mar 17, 1998, 4:06:35 PM (26 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '38dfc5131670d387a89455159ed1e071997eec94')
Children:
fc732a9d4c770726f143d87d99fa55800945885b
Parents:
6f5db891dcfcc0310e9d93a88bb7a41cff0e8529
Message:
* hannes/lamm: fixed hnoether.lib


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

Legend:

Unmodified
Added
Removed
  • Singular/LIB/hnoether.lib

    r6f5db8 rbb17e8  
    1 // $Id: hnoether.lib,v 1.2 1998-03-06 11:52:55 krueger Exp $
    2 // This library requires Singular 1.0
     1// $Id: hnoether.lib,v 1.3 1998-03-17 15:06:35 Singular Exp $
     2// author:  Martin Lamm,  email: lamm@mathematik.uni-kl.de
     3// last change:           13.03.98
    34///////////////////////////////////////////////////////////////////////////////
    45
     
    1415 displayInvariants(hne);  display invariants of f
    1516 generators(hne);    computes the generators of the semigroup of values
     17 intersection(hne1,hne2); intersection multiplicity of two curves
     18 stripHNE(hne);      reduce amount of memory consumed by hne
    1619
    1720           perhaps useful procedures:
    1821 puiseux2generators(m,n); convert puiseux pairs to generators of semigroup
     22 multiplicities(hne);     multiplicities of blowed up curves
    1923 newtonpoly(f);      newtonpolygon of polynom f
    2024 newtonhoehne(f);    same as newtonpoly, but uses internal procedure
     
    8084}
    8185///////////////////////////////////////////////////////////////////////////////
    82 proc T_Transform (poly f, int Q, int N) 
     86proc T_Transform (poly f, int Q, int N)
    8387// returns f(y,xy^Q)/y^NQ
    8488{
     
    8791}
    8892///////////////////////////////////////////////////////////////////////////////
    89 proc T1_Transform (poly f, number d, int M) 
     93proc T1_Transform (poly f, number d, int M)
    9094// returns f(x,y+d*x^M)
    9195{
     
    102106  int ggt=gcd(M,N);
    103107  M=M/ggt; N=N/ggt;
    104   list ts=extgcd(M,N); 
     108  list ts=extgcd(M,N);
    105109  int tau,sigma=ts[2],-ts[3];
    106110  if (sigma<0) { tau=-tau; sigma=-sigma;}
     
    130134  poly hilf;
    131135 // dividiere f so lange durch x, wie die Div. aufgeht:
    132   for (hilf=f/x; hilf*x==f; hilf=f/x) {f=hilf;} 
     136  for (hilf=f/x; hilf*x==f; hilf=f/x) {f=hilf;}
    133137  for (hilf=f/y; hilf*y==f; hilf=f/y) {f=hilf;} // gleiches fuer y
    134138  return(list(T1(f),d));
     
    142146{
    143147  matrix mat = coeffs(coeffs(f,y)[J+1,1],x);
    144   if (size(mat) <= I) { return(0);} 
     148  if (size(mat) <= I) { return(0);}
    145149  else { return(leadcoef(mat[I+1,1]));}
    146150}
     
    164168 // Rueckgabe evtl. nicht quadratfrei! Bsp.: squarefree((1/a*x3+y7)^3);
    165169 // in char 7
     170 // In Singular 1.1.3 funktioniert syz, dafuer geht das gleiche Bsp. schief,
     171 // weil gcd auf einmal falsch wird! (ring (7,a),(x,y),dp; minpoly=a2+1; )
    166172
    167173 //----------------- Wechsel in geeigneten Ring & Variablendefinition ---------
    168174  def altring = basering;
    169   if (size(parstr(altring))==1) {string mipl=string(minpoly);}
     175  int e;
     176  int gcd_ok=1;
     177  string mipl="0";
     178  if (size(parstr(altring))==1) {mipl=string(minpoly);}
     179 //---- test: char = (p^k,a) (-> gcd not implemented) or (p,a) (gcd works) ----
     180  if ((char(basering)!=0) and (charstr(basering)!=string(char(basering)))) {
     181    string tststr=charstr(basering);
     182    tststr=tststr[1..find(tststr,",")-1];           //-> "p^k" bzw. "p"
     183    gcd_ok=(tststr==string(char(basering)));
     184  }
    170185  execute("ring rsqrf = ("+charstr(altring)+"),(x,y),dp;");
    171   if (size(parstr(altring))==1) { execute "minpoly="+mipl+";"; }
     186  if ((gcd_ok!=0) && (mipl!="0")) { execute "minpoly="+mipl+";"; }
    172187  poly f=fetch(altring,f);
    173188  poly dif,g,l;
    174   int e;
    175  //-------------------- Berechne f/ggT(f,df/dx,df/dy) ------------------------
    176   dif=diff(f,x);
    177   if (dif==0) { g=f; }        // zur Beschleunigung
    178   else { g=gcd(f,dif); }
    179   if (g!=1) {                 // sonst schon sicher, dass f quadratfrei
    180    dif=diff(f,y);
    181    if (dif!=0) { g=gcd(g,dif); }
    182   }
    183   if (g!=1) {
    184    e=0;
    185    if (g==f) { l=1; }         // zur Beschleunigung
    186    else {
    187      module m=syz(ideal(g,f));
    188      if (deg(m[2,1])>0) {
    189        "!! The Singular command 'syz' has returned a wrong result !!";
    190        l=1;                   // Division f/g muss aufgehen
     189  if (gcd_ok!=0) {
     190 //-------------------- Berechne f/ggT(f,df/dx,df/dy) ------------------------
     191    dif=diff(f,x);
     192    if (dif==0) { g=f; }        // zur Beschleunigung
     193    else { g=gcd(f,dif); }
     194    if (g!=1) {                 // sonst schon sicher, dass f quadratfrei
     195     dif=diff(f,y);
     196     if (dif!=0) { g=gcd(g,dif); }
     197    }
     198    if (g!=1) {
     199     e=0;
     200     if (g==f) { l=1; }         // zur Beschleunigung
     201     else {
     202       module m=syz(ideal(g,f));
     203       if (deg(m[2,1])>0) {
     204         "!! The Singular command 'syz' has returned a wrong result !!";
     205         l=1;                   // Division f/g muss aufgehen
     206       }
     207       else { l=m[1,1]; }
    191208     }
    192      else { l=m[1,1]; }
    193    }
    194209 //----------------------------------------------------------------------------
    195210 // Polynomdivision geht, wenn factory eingebunden ist
     
    198213 // werden, sollte dann also zum Einsatz gebracht werden (Zeitersparnis)
    199214 //----------------------------------------------------------------------------
    200   }
    201   else { e=1; }
     215    }
     216    else { e=1; }
     217  }
     218  else {
     219 //------------------- Berechne syz(f,df/dx) oder syz(f,df/dy) ----------------
     220 //-- Achtung: Ist f reduzibel, koennen Faktoren mit Ableitung Null verloren --
     221 //-- gehen! Ist aber nicht weiter schlimm, weil char (p^k,a) nur im irred.  --
     222 //-- Fall vorkommen kann. Wenn f nicht g^p ist, wird auf jeden Fall         --
     223 //------------------------ ein Faktor gefunden. ------------------------------
     224    dif=diff(f,x);
     225    if (dif == 0) {
     226     dif=diff(f,y);
     227     if (dif==0) { e=2; l=1; } // f is of power divisible by char of basefield
     228     else { l=syz(ideal(dif,f))[1,1];  // x^p+y^(p-1) abgedeckt
     229            if (deg(l)==deg(f)) { e=1;}
     230            else {e=0;}
     231     }
     232    }
     233    else { l=syz(ideal(dif,f))[1,1];
     234           if (deg(l)==deg(f)) { e=1;}
     235           else {e=0;}
     236    }
     237  }
    202238 //--------------- Wechsel in alten Ring und Rueckgabe des Ergebnisses --------
    203239  setring altring;
     
    276312  if ((leadcoef(f)<-16001) or (leadcoef(f)>16001)) {verbrecher=lead(f);}
    277313  leitexp=leadexp(f);
    278   if (( ((leitexp[1] % 32003) == 0)   and (leitexp[1]<>0)) 
     314  if (( ((leitexp[1] % 32003) == 0)   and (leitexp[1]<>0))
    279315     or ( ((leitexp[2] % 32003) == 0) and (leitexp[2]<>0)) )
    280316       {verbrecher=lead(f);}
     
    302338              Hamburger-Noether development a posteriori without having to do
    303339              all the previous calculation once again (0 if not needed)
    304 DISPLAY: the (non zero) elements of the HNE
    305 
    306 NOTE:    if the optional parameter n is given, the HN-matrix will have at least
    307          n rows. Otherwise the number of rows will be chosen minimal, such that
     340DISPLAY: The (non zero) elements of the HNE
     341
     342NOTE:    If the optional parameter n is given, the HN-matrix will have at least
     343         n columns. Otherwise the number of columns will be chosen minimal s.t.
    308344         the matrix contains all necessary information (i.e. all lines of the
    309          HNE but the last (which is in general infinite) have place).
     345         HNE but the last (which is in general infinite) appear).
    310346         If n is negative, the algorithm is stopped as soon as possible, i.e.
    311347         the information computed is enough for 'invariants', but the HN-matrix
    312348         may contain undetermined elements, which are marked with the
    313          2nd variable.
     349         2nd variable (of the basering).
    314350         In any case, the optional parameter only affects the calculation of
    315351         the LAST line of the HNE; develop(f) gives already all necessary
     
    318354         faster; a positive value will improve the exactness of the
    319355         parametrization.
     356
     357         For time critical computations it is recommended to use
     358         "ring ...,(x,y),ls" as basering - it increases the algorithm's speed.
    320359
    321360EXAMPLES: example develop; shows an example
     
    341380 //----------------------------------------------------------------------------
    342381
    343  if (char(basering)==-1) {
     382 if (charstr(basering)=="real") {
    344383  "The algorithm doesn't work with 'real' as coefficient field.";
    345384                     // denn : map from characteristic -1 to -1 not implemented
     
    359398 //---- Ende der unzulaessigen Ringe; Ringwechsel in einen guenstigen Ring: ---
    360399
     400 int ringwechsel=(varstr(basering)!="x,y") or (ordstr(basering)!="ls(2),C");
     401
    361402 def altring = basering;
    362  execute("ring guenstig = ("+charstr(altring)+"),(x,y),ls;");
     403 if (ringwechsel) {
     404   string mipl=string(minpoly);
     405   execute("ring guenstig = ("+charstr(altring)+"),(x,y),ls;");
     406   if ((char(basering)==0) && (mipl!="0")) {
     407     execute "minpoly="+mipl+";";
     408   }}
     409 else { def guenstig=basering; }
    363410 export guenstig;
    364411
    365412 //-------------------------- Initialisierungen -------------------------------
    366413 map m=altring,x,y;
    367  poly f=m(f);
     414 if (ringwechsel) { poly f=m(f); }
    368415 if (defined(Protokoll))
    369416 {"received polynomial: ",f,", where x =",namex,", y =",namey;}
     
    388435 string ringchar=charstr(basering);
    389436 map xytausch = basering,y,x;
    390  if ((p!=0) and (ringchar != string(p))) { 
     437 if ((p!=0) and (ringchar != string(p))) {
    391438                            // coefficient field is extension of Z/pZ
    392    execute "int n_elements="+ringchar[1,size(ringchar)-2]+";"; 
     439   execute "int n_elements="+ringchar[1,size(ringchar)-2]+";";
    393440                            // number of elements of actual ring
    394441   number generat=par(1);   // generator of the coefficient field of the ring
     
    402449   intvec nm = getnm(f);
    403450   N = nm[1]; M = nm[2]; //Berechne Schnittpunkte Newtonpolygon mit Achsen
    404    if (N == 0) {" The given polynomial is a unit!!"; Abbruch=1; Ausgabe=1;}
     451   if (N == 0)
     452   {" The given polynomial is a unit as power series!!"; Abbruch=1; Ausgabe=1;}
    405453   else {
    406454    if (N == -1) {"The HNE is x = 0"; Abbruch=1; Ausgabe=2; getauscht=1;}
     
    444492      if (test_sqr != f) {
    445493       "The given polynomial is in fact not squarefree.";
    446        "I'll continue with the radical.",
    447        "If you want to stop now, press <Ctrl> c";
     494       "I'll continue with the radical.";
    448495       pause;
    449496       f=test_sqr;
     
    452499    }
    453500    else {
    454       if ((str=="s") and (testerg==1)) { 
     501      if ((str=="s") and (testerg==1)) {
    455502       "(*) attention: it could be that the factor is only one in char 32003!";
    456503        f=polyhinueber(test_sqr);
     
    485532    if (p != 0)
    486533     {"But if the polynomial contains a factor of the form g^"+string(p)+",";
    487       "this factor will be lost. If you want to stop now, press <Ctrl> c";}
    488     else {"If you want to stop now, press <Ctrl> c";}
     534      "this factor will be lost.";}
    489535    pause;
    490536    f=test_sqr;
     
    497543
    498544  if (N==0) {
    499     " Sorry. The remaining polynomial is a unit...";
     545    " Sorry. The remaining polynomial is a unit in the power series ring...";
    500546    setring altring;kill guenstig;return(return_error);
    501547  }
     
    556602        delta = koeff(f,(M/ e)*p^l,(N/ e)*p^l*(eps-1)) / (-1*eps*c);
    557603
    558         if ((ringchar != string(p)) and (delta != 0)) { 
     604        if ((ringchar != string(p)) and (delta != 0)) {
    559605 //- coeff. field is not Z/pZ => we`ve to correct delta by taking (p^l)th root-
    560606          if (delta == generat) {exponent=1;}
     
    639685 //-------------------- Ergebnis in den alten Ring transferieren: -------------
    640686   map zurueck=guenstig,maxideal(1)[1],maxideal(1)[2];
    641    matrix a[zeile+1][maxspalte];
     687   matrix amat[zeile+1][maxspalte];
    642688   ideal uebergabe;
    643689   for (e=0; e<=zeile; e=e+1) {
    644690     uebergabe=zurueck(a(e));
    645  //---------- n.b.: im alten Ring ist a(i) Ideal, im neuen die Matrix ---------
    646  //----------   (aber gleicher Inhalt: die Koeffizienten der HNE)     ---------
    647691     if (ncols(uebergabe) > 1) {
    648       a[e+1,1..ncols(uebergabe)]=uebergabe;}
    649      else {a[e+1,1]=uebergabe[1];}
     692      amat[e+1,1..ncols(uebergabe)]=uebergabe;}
     693     else {amat[e+1,1]=uebergabe[1];}
    650694   }
    651    f=zurueck(f);
     695   if (ringwechsel) { f=zurueck(f); }
    652696 }
    653697
    654698 kill guenstig;
    655  if (Ausgabe == 0) { return(list(a,hqs,getauscht,f));}
     699 if (Ausgabe == 0) { return(list(amat,hqs,getauscht,f));}
    656700 if (Ausgabe == 1) { return(return_error);}             // error has occurred
    657  if (Ausgabe == 2) { return(list(matrix(0),intvec(1),getauscht,poly(0)));}
    658 }                                                       // HNE is x=0 or y=0
     701 if (Ausgabe == 2) { return(list(matrix(ideal(0,x)),intvec(1),getauscht,
     702                                 poly(0)));}            // HNE is x=0 or y=0
     703}
    659704example
    660705{ "EXAMPLE:"; echo = 2;
     
    675720  // (the term -t109 in y may have a wrong coefficient)
    676721  displayHNE(hne);
    677   setring exring; kill displayring;
    678722}
    679723
     
    690734        will be  zero. If not, the real parametrisation will be
    691735        two power series; then param will return a truncation of these series.
    692 EXAMPLES: example develop; shows an example
    693           example param;   shows another example
     736EXAMPLE: example param;      shows an example
     737         example developp;   shows another example
    694738
    695739{
     
    794838        and computes some invariants:
    795839RETURN:  a list, if l contains a valid HNE:
    796     - invariants(l)[1]=intvec(characteristic exponents)
     840    - invariants(l)[1]: intvec         (characteristic exponents)
    797841    - invariants(1)[2],[3]: 2 x intvec (puiseux pairs, 1st and 2nd components)
    798     - invariants(l)[4]=int(degree of the conductor)
     842    - invariants(l)[4]: int            (degree of the conductor)
     843    - invariants(l)[5]: intvec         (sequence of multiplicities)
    799844         an empty list, if an error occurred in the procedure develop
    800845EXAMPLE: example invariants; shows an example
     
    809854   return(ergebnis);
    810855 }
    811  intvec beta,s,svorl,ordnung;
    812  int genus,zeile,i,k,summe,conductor,ggT;
     856 intvec beta,s,svorl,ordnung,multips,multseq,mpuiseux,npuiseux;
     857 int genus,zeile,i,j,k,summe,conductor,ggT;
    813858 string Ausgabe;
    814859 int nc=ncols(m); int nr=nrows(m);
     
    838883 }
    839884 //--------------------------- Puiseuxpaare -----------------------------------
    840  intvec mpuiseux,npuiseux;
    841885 int produkt=1;
    842886 for (i=1; i<=genus; i++) {
     
    854898 }
    855899 conductor=summe;
     900 //------------------- Multiplizitaetensequenz: -------------------------------
     901 k=1;
     902 multips=multiplicities(#);
     903 for (i=1; i<size(v); i++) {
     904   for (j=1; j<=v[i]; j++) {
     905     multseq[k]=multips[i];
     906     k++;
     907 }}
     908 multseq[k]=1;
    856909 //------------------------- Rueckgabe ----------------------------------------
    857  ergebnis=beta,mpuiseux,npuiseux,conductor;
     910 ergebnis=beta,mpuiseux,npuiseux,conductor,multseq;
    858911 return(ergebnis);
    859912}
     
    866919 erg[2],erg[3];            // the puiseux pairs in packed form
    867920 erg[4] / 2;               // the delta-invariant
     921 erg[5];                   // the sequence of multiplicities
    868922                           // To display the invariants more 'nicely':
    869923 displayInvariants(hne);
     
    875929         develop(f) and reddevelop(f)
    876930          ( list l (matrix m, intvec v, int s[,poly g])
    877             or list of lists in the form l             )
     931            or list of lists in the form l            )
    878932DISPLAY: invariants of the corresponding branch, resp. of all branches,
    879933         in a better readable form
    880934RETURN:  nothing
    881 EXAMPLE: example invariants;  shows an example
    882 {
    883  int i;
     935EXAMPLE: example displayInvariants;  shows an example
     936{
     937 int i,j,k,mul;
    884938 string Ausgabe;
    885939 list ergebnis;
     940 //-- entferne ueberfluessige Daten zur Erhoehung der Rechengeschwindigkeit: --
     941 #=stripHNE(#);
    886942 //-------------------- Ausgabe eines Zweiges ---------------------------------
    887943 if (typeof(#[1])=="matrix") {
    888944   ergebnis=invariants(#);
    889945   if (size(ergebnis)!=0) {
    890     " characteristic exponents :",ergebnis[1];
     946    " characteristic exponents  :",ergebnis[1];
    891947    if (size(ergebnis[1])>1) {
    892948     for (i=1; i<=size(ergebnis[2]); i++) {
     
    894950       +string(ergebnis[3][i])+")";
    895951    }}
    896     " puiseux pairs :           ",Ausgabe;
    897     " the degree of the conductor is",ergebnis[4];
    898     " the delta invariant is        ",ergebnis[4]/2;
    899     " the generators of the semigroup of values are",
    900     puiseux2generators(ergebnis[2],ergebnis[3]);
     952    " puiseux pairs             :",Ausgabe;
     953    " degree of the conductor   :",ergebnis[4];
     954    " delta invariant           :",ergebnis[4]/2;
     955    " generators of semigroup   :",puiseux2generators(ergebnis[2],ergebnis[3]);
     956    " sequence of multiplicities:",ergebnis[5];
    901957 }}
    902958 //-------------------- Ausgabe aller Zweige ----------------------------------
    903959 else {
    904   for (int j=1; j<=size(#); j++) {
     960  for (j=1; j<=size(#); j++) {
    905961    ergebnis=invariants(#[j]);
    906962    " --- invariants of branch number",j,": ---";
    907     " characteristic exponents :",ergebnis[1];
     963    " characteristic exponents  :",ergebnis[1];
    908964    Ausgabe="";
    909965    if (size(ergebnis[1])>1) {
     
    912968       +string(ergebnis[3][i])+")";
    913969    }}
    914     " puiseux pairs :           ",Ausgabe;
    915     " the degree of the conductor is",ergebnis[4];
    916     " the delta invariant is        ",ergebnis[4]/2;
    917     " the generators of the semigroup of values are",
    918     puiseux2generators(ergebnis[2],ergebnis[3]);
     970    " puiseux pairs             :",Ausgabe;
     971    " degree of the conductor   :",ergebnis[4];
     972    " delta invariant           :",ergebnis[4]/2;
     973    " generators of semigroup   :",puiseux2generators(ergebnis[2],ergebnis[3]);
     974    " sequence of multiplicities:",ergebnis[5];
    919975    "";
    920976  }
     977  if (size(#)>1) {
     978    " -------------- intersection multiplicities : -------------- ";"";
     979    Ausgabe="branch |   ";
     980    for (j=size(#); j>1; j--) {
     981      if (size(string(j))==1) { Ausgabe=Ausgabe+" "+string(j)+"    "; }
     982      else                    { Ausgabe=Ausgabe+string(j)+"    "; }
     983    }
     984    Ausgabe;
     985    Ausgabe="-------+";
     986    for (j=2; j<size(#); j++) { Ausgabe=Ausgabe+"------"; }
     987    Ausgabe=Ausgabe+"-----";
     988    Ausgabe;
     989  }
     990  for (j=1; j<size(#); j++) {
     991    if (size(string(j))==1) { Ausgabe="    "+string(j)+"  |"; }
     992    else                    { Ausgabe="   " +string(j)+"  |"; }
     993    for (k=size(#); k>j; k--) {
     994      mul=intersection(#[j],#[k]);
     995      for (i=1; i<=5-size(string(mul)); i++) { Ausgabe=Ausgabe+" "; }
     996      Ausgabe=Ausgabe+string(mul);
     997      if (k>j+1) { Ausgabe=Ausgabe+","; }
     998    }
     999    Ausgabe;
     1000  }
    9211001 }
    9221002 return();
     1003}
     1004example
     1005{ "EXAMPLE:"; echo = 2;
     1006 ring exring=0,(x,y),dp;
     1007 list hne=develop(y4+2x3y2+x6+x5y);
     1008 displayInvariants(hne);
     1009}
     1010///////////////////////////////////////////////////////////////////////////////
     1011
     1012proc multiplicities
     1013USAGE:   multiplicities(l) takes the output of develop(f)
     1014         (list l (matrix m, intvec v, int s[,poly g]))
     1015RETURN:  intvec of the different multiplicities that occur during the succes-
     1016         sive blowing up of the curve corresponding to f
     1017EXAMPLE: example multiplicities;  shows an example
     1018{
     1019 matrix m=#[1];
     1020 intvec v=#[2];
     1021 int switch=#[3];
     1022 list ergebnis;
     1023 if (switch==-1) {
     1024   "An error has occurred in develop, so there is no HNE.";
     1025   return(intvec(0));
     1026 }
     1027 intvec ordnung;
     1028 int zeile,k;
     1029 int nc=ncols(m); int nr=nrows(m);
     1030 ordnung[nr]=1;
     1031 //---------------- Bestimme den Untergrad der einzelnen Zeilen ---------------
     1032 for (zeile=nr; zeile>1; zeile--) {
     1033   if ((size(ideal(m[zeile,1..nc])) > 1) or (zeile==nr)) { // keine Nullzeile
     1034      k=1;
     1035      while (m[zeile,k]==0) {k++;}
     1036      ordnung[zeile-1]=k*ordnung[zeile];
     1037   }
     1038   else {
     1039      ordnung[zeile-1]=v[zeile]*ordnung[zeile]+ordnung[zeile+1];
     1040 }}
     1041 return(ordnung);
     1042}
     1043example
     1044{ "EXAMPLE:"; echo = 2;
     1045  ring r=0,(x,y),dp;
     1046  multiplicities(develop(x5+y7));
     1047  // The first value is the multiplicity of the curve itself, here it's 5
    9231048}
    9241049///////////////////////////////////////////////////////////////////////////////
     
    9691094}
    9701095///////////////////////////////////////////////////////////////////////////////
    971 proc displayHNE
    972 USAGE:   displayHNE(l) takes the output of develop(f)
    973          (list l (matrix m, intvec v, int s[,poly g]))
    974 RETURN:  an ideal of the following form:
    975          _[1]=-y+[]*z(0)^1+[]*z(0)^2+...+z(0)^\{\}*z(1)
    976          _[2]=-x+          []*z(1)^2+...+z(1)^\{\}*z(2)
    977          _[3]=             []*z(2)^2+...+z(2)^\{\}*z(3)
    978           ...              ..........................
    979          _[r+1]=           []*z(r)^2+...
    980      where x,y are the indeterminants of the basering. The values of [] are
    981      the coefficients of the Hamburger-Noether-matrix, the values of \{\} are
     1096
     1097proc intersection (list hn1, list hn2)
     1098USAGE:   intersection(hne1,hne2);
     1099         hne1,hne2 two lists representing a HNE (normally two entries out of
     1100         the output of reddevelop), i.e. list(matrix,intvec,int[,poly])
     1101RETURN:  intersection multiplicity of the branches corresponding to hne1 & hne2
     1102         (of type int)
     1103EXAMPLE: example intersection;  shows an example
     1104{
     1105 //------------------ `intersect' ist schon reserviert ... --------------------
     1106 int i,j,s,sum,schnitt,unterschied;
     1107 matrix a1=hn1[1];
     1108 matrix a2=hn2[1];
     1109 intvec h1=hn1[2];
     1110 intvec h2=hn2[2];
     1111 intvec n1=multiplicities(hn1);
     1112 intvec n2=multiplicities(hn2);
     1113 if (hn1[3]!=hn2[3]) {
     1114 //-- die jeweils erste Zeile von hn1,hn2 gehoert zu verschiedenen Parametern -
     1115 //---------------- d.h. beide Kurven schneiden sich transversal --------------
     1116   schnitt=n1[1]*n2[1];        // = mult(hn1)*mult(hn2)
     1117 }
     1118 else {
     1119 //--------- die jeweils erste Zeile gehoert zum gleichen Parameter -----------
     1120   unterschied=0;
     1121 //h1[1],h2[1];size(h1),size(h2);
     1122   for (s=1; (h1[s]==h2[s]) && (s<size(h1)) && (s<size(h2))
     1123              && (unterschied==0); s++) {
     1124     for (i=1; (a1[s,i]==a2[s,i]) && (i<=h1[s]); i++) {;}
     1125     if (i<=h1[s]) {
     1126       unterschied=1;
     1127       s--;                    // um s++ am Schleifenende wieder auszugleichen
     1128     }
     1129   }
     1130   if (unterschied==0) {
     1131     if ((s<size(h1)) && (s<size(h2))) {
     1132       for (i=1; (a1[s,i]==a2[s,i]) && (i<=h1[s]) && (i<=h2[s]); i++) {;}
     1133     }
     1134     else {
     1135 //-------------- Sonderfall: Unterschied in letzter Zeile suchen -------------
     1136 // Beachte: Es koennen undefinierte Stellen auftreten, bei abbrechender HNE
     1137 // muss die Ende-Markierung weg, h_[r] ist unendlich, die Matrix muss mit
     1138 // Nullen fortgesetzt gedacht werden
     1139 //----------------------------------------------------------------------------
     1140       if (ncols(a1)>ncols(a2)) { j=ncols(a1); }
     1141       else                     { j=ncols(a2); }
     1142       unterschied=0;
     1143       if ((h1[s]>0) && (s==size(h1))) {
     1144         a1[s,h1[s]+1]=0;
     1145         if (ncols(a1)<=ncols(a2)) { unterschied=1; }
     1146       }
     1147       if ((h2[s]>0) && (s==size(h2))) {
     1148         a2[s,h2[s]+1]=0;
     1149         if (ncols(a2)<=ncols(a1)) { unterschied=1; }
     1150       }
     1151       if (unterschied==1) {                   // mind. eine HNE war endlich
     1152         matrix ma1[1][j]=a1[s,1..ncols(a1)];  // und bedarf der Fortsetzung
     1153         matrix ma2[1][j]=a2[s,1..ncols(a2)];  // mit Nullen
     1154       }
     1155       else {
     1156         if (ncols(a1)>ncols(a2)) { j=ncols(a2); }
     1157         else                     { j=ncols(a1); }
     1158         matrix ma1[1][j]=a1[s,1..j];          // Beschr. auf vergleichbaren
     1159         matrix ma2[1][j]=a2[s,1..j];          // Teil (der evtl. y's enth.)
     1160       }
     1161 // print(ma1);print(ma2);
     1162       for (i=1; (ma1[1,i]==ma2[1,i]) && (i<j) && (ma1[1,i]!=var(2)); i++) {;}
     1163       if (ma1[1,i]==ma2[1,i]) {
     1164         "//** The two HNE's are identical!";
     1165         "//** You have either tried to intersect a branch with itself,";
     1166         "//** or the two branches have been developed separately.";
     1167         "//   In the latter case use `extdevelop' to extend the HNE's until",
     1168         "they differ.";
     1169         return(-1);
     1170       }
     1171       if ((ma1[1,i]==var(2)) || (ma2[1,i]==var(2))) {
     1172         "//** The two HNE's are (so far) identical. This is because they",
     1173         "have been";
     1174         "//** computed separately. I need more data; use `extdevelop' to",
     1175         "extend them,";
     1176         if (ma1[1,i]==var(2)) {"//** at least the first one.";}
     1177         else                  {"//** at least the second one.";}
     1178         return(-1);
     1179       }
     1180     }
     1181   }
     1182   sum=0;
     1183   h1[size(h1)]=ncols(a1)+42;        // Ersatz fuer h1[r]=infinity
     1184   h2[size(h2)]=ncols(a2)+42;
     1185   for (j=1; j<s; j++) {sum=sum+h1[j]*n1[j]*n2[j];}
     1186   if ((i<=h1[s]) && (i<=h2[s]))    { schnitt=sum+i*n1[s]*n2[s]; }
     1187   if (i==h2[s]+1) { schnitt=sum+h2[s]*n1[s]*n2[s]+n2[s+1]*n1[s]; }
     1188   if (i==h1[s]+1) { schnitt=sum+h1[s]*n2[s]*n1[s]+n1[s+1]*n2[s]; }
     1189 // "s:",s-1,"i:",i,"S:",sum;
     1190 }
     1191 return(schnitt);
     1192}
     1193example
     1194{
     1195  if (nameof(basering)=="HNEring") {
     1196   def rettering=HNEring;
     1197   kill HNEring;
     1198  }
     1199  "EXAMPLE:"; echo = 2;
     1200  ring r=0,(x,y),dp;
     1201  list hne=reddevelop((x2-y3)*(x2+y3));
     1202  intersection(hne[1],hne[2]);
     1203  kill HNEring,r;
     1204  echo = 0;
     1205  if (defined(rettering)) { // wenn aktueller Ring vor Aufruf von example
     1206   setring rettering;       // HNEring war, muss dieser erst wieder restauriert
     1207   def HNEring=rettering;   // werden
     1208   export HNEring;
     1209  }
     1210}
     1211///////////////////////////////////////////////////////////////////////////////
     1212
     1213proc displayHNE(list ldev,list #)
     1214USAGE:   displayHNE(ldev,[,n]); ldev=list
     1215         (output list of develop(f) or reddevelop(f)), n=int
     1216RETURN:  - if only one argument is given, no return value, but
     1217         display an ideal HNE of the following form:
     1218            HNE[1]=-y+[]*z(0)^1+[]*z(0)^2+...+z(0)^<>*z(1)
     1219            HNE[2]=-x+          []*z(1)^2+...+z(1)^<>*z(2)
     1220            HNE[3]=             []*z(2)^2+...+z(2)^<>*z(3)
     1221            .......             ..........................
     1222            HNE[r+1]=           []*z(r)^2+[]*z(r)^3+......
     1223     where x,y are the indeterminates of the basering. The values of [] are
     1224     the coefficients of the Hamburger-Noether matrix, the values of <> are
    9821225     represented in the HN-matrix as 'x'
    983          the 1st line (_[1]) means that y==[]*z(0)^1+... ,
    984          the 2nd line (_[2]) means that x==[]*z(1)^1+...
     1226         the 1st line (HNE[1]) means that y==[]*z(0)^1+... ,
     1227         the 2nd line (HNE[2]) means that x==[]*z(1)^1+...
    9851228     so you can see which indeterminate corresponds to which line
    9861229     (it's also possible that x corresponds to the 1st line and y to the 2nd)
    987 NOTE:    to create this ideal, it is necessary to change the ring. displayHNE
    988          does this change --- the new ring has the name 'displayring'.
    989 EXAMPLE: example develop; shows an example
    990 {
     1230         - if a second argument is given, create and export a new ring with
     1231         name 'displayring' containing an ideal 'HNE' as described above
     1232
     1233     If ldev contains the output of reddevelop(f), displayHNE shows the HNE's
     1234     of all branches of f in the form described above.
     1235     The optional parameter is then ignored.
     1236EXAMPLE: example displayHNE; shows an example
     1237{
     1238 if ((typeof(ldev[1])=="list") || (typeof(ldev[1])=="none")) {
     1239   for (int i=1; i<=size(ldev); i++) {
     1240     "// Hamburger-Noether development of branch nr."+string(i)+":";
     1241     displayHNE(ldev[i]);"";
     1242   }
     1243   return();
     1244 }
    9911245 //--------------------- Initialisierungen und Ringwechsel --------------------
    992  matrix m=#[1];
    993  intvec v=#[2];
    994  int switch=#[3];
     1246 matrix m=ldev[1];
     1247 intvec v=ldev[2];
     1248 int switch=ldev[3];
    9951249 if (switch==-1) {
    9961250   "An error has occurred in develop, so there is no HNE.";
    9971251   return(ideal(0));
     1252 }
     1253 if (parstr(basering)!="") {
     1254   if (charstr(basering)!=string(char(basering))+","+parstr(basering)) {
     1255     "Sorry -- not implemented for rings of type (p^k,a),...";
     1256     return(ideal(0));
     1257   }
    9981258 }
    9991259 def altring=basering;
     
    10011261 def displayring=dazu+altring;
    10021262 setring displayring;
    1003  export displayring;
     1263 if (size(#) != 0) {
     1264    export displayring;
     1265  }
    10041266 map holematrix=altring,0;        // mappt nur die Monome vom Grad Null
    10051267 matrix m=holematrix(m);
     
    10111273 }
    10121274 matrix displaymat=m*n;
    1013  ideal displayid;
    1014  for (i=1; i<nrows(m); i++) { displayid[i]=displaymat[i,i]+z(i)*z(i-1)^v[i]; }
    1015  displayid[nrows(m)]=displaymat[nrows(m),nrows(m)];
     1275 ideal HNE;
     1276 for (i=1; i<nrows(m); i++) { HNE[i]=displaymat[i,i]+z(i)*z(i-1)^v[i]; }
     1277 HNE[nrows(m)]=displaymat[nrows(m),nrows(m)];
     1278 if (nrows(m)<2) { HNE[2]=z(0); }
    10161279 if (switch==0) {
    1017     displayid[1] = displayid[1]-var(size(v)+2);
    1018     displayid[2] = displayid[2]-var(size(v)+1);
     1280    HNE[1] = HNE[1]-var(size(v)+2);
     1281    HNE[2] = HNE[2]-var(size(v)+1);
    10191282 }
    10201283 else {
    1021     displayid[1] = displayid[1]-var(size(v)+1);
    1022     displayid[2] = displayid[2]-var(size(v)+2);
    1023  }
    1024  keepring(displayring);
    1025  return(displayid);
    1026 }
    1027 
    1028 
     1284    HNE[1] = HNE[1]-var(size(v)+1);
     1285    HNE[2] = HNE[2]-var(size(v)+2);
     1286 }
     1287if (size(#) == 0) {
     1288   HNE;
     1289   return();
     1290 }
     1291if (size(#) != 0) {
     1292   "// basering is now 'displayring' containing ideal 'HNE'";
     1293   keepring(displayring);
     1294   export(HNE);
     1295   return(HNE);
     1296 }
     1297}
     1298example
     1299{ "EXAMPLE:"; echo = 2;
     1300  ring r=0,(x,y),dp;
     1301  poly f=x3+2xy2+y2;
     1302  list hn=develop(f);
     1303  displayHNE(hn);
     1304}
    10291305///////////////////////////////////////////////////////////////////////////////
    10301306//                      procedures for reducible curves                      //
     
    10821358 //- finde alle Monome auf der Geraden durch A und C (unterhalb gibt's keine) -
    10831359   hilf=jet(f,A[2]*C[1]-A[1]*C[2],intvec(A[2]-C[2],C[1]-A[1]));
    1084        
     1360
    10851361   H=leadexp(xytausch(hilf));
    10861362   D=H[2],H[1];
     
    12651541     }
    12661542     else {
    1267        execute "ring extdguenstig=("+charstr(basering)+"),(x,y),ls;";     
     1543       execute "ring extdguenstig=("+charstr(basering)+"),(x,y),ls;";
    12681544     }
    12691545  }
     
    13321608}
    13331609example
    1334 { "EXAMPLE:"; echo = 2;
     1610{
     1611  if (nameof(basering)=="HNEring") {
     1612   def rettering=HNEring;
     1613   kill HNEring;
     1614  }
     1615  "EXAMPLE:"; echo = 2;
    13351616  ring exring=0,(x,y),dp;
    13361617  list hne=reddevelop(x14-3y2x11-y3x10-y2x9+3y4x8+y5x7+3y4x6+x5*(-y6+y5)-3y6x3-y7x2+y8);
     
    13471628  print(extdevelop(develop(x-y2-2y3-3y4),4)[1]);
    13481629  print(extdevelop(develop(x-y2-2y3-3y4),10)[1]);
     1630  kill HNEring,exring;
     1631  echo = 0;
     1632  if (defined(rettering)) { // wenn aktueller Ring vor Aufruf von example
     1633   setring rettering;       // HNEring war, muss dieser erst wieder restauriert
     1634   def HNEring=rettering;   // werden
     1635   export HNEring;
     1636  }
     1637}
     1638///////////////////////////////////////////////////////////////////////////////
     1639
     1640proc stripHNE (list l)
     1641USAGE:   stripHNE(l);    takes the output both of develop(f) and reddevelop(f)
     1642           ( list l (matrix m, intvec v, int s[,poly g])
     1643             or list of lists in the form l            )
     1644RETURN:  a list in the same format as l, but all polynomials g are set to zero
     1645NOTE:    The purpose of this procedure is to remove huge amounts of data
     1646         no longer needed. It is useful, if one or more of the polynomials
     1647         in l consumes much memory. It is still possible to compute invariants,
     1648         parametrizations etc. with the stripped HNE(s), but it is not possible
     1649         to use extdevelop with them.
     1650EXAMPLE: example stripHNE;  shows an example
     1651{
     1652 list h;
     1653 if (typeof(l[1])=="matrix") { l[4]=poly(0); }
     1654 else {
     1655  for (int i=1; i<=size(l); i++) {
     1656    h=l[i];
     1657    h[4]=poly(0);
     1658    l[i]=h;
     1659  }
     1660 }
     1661 return(l);
     1662}
     1663example
     1664{ "EXAMPLE:"; echo = 2;
     1665  ring r=0,(x,y),dp;
     1666  list hne=develop(x2+y3+y4);
     1667  hne;
     1668  stripHNE(hne);
    13491669}
    13501670///////////////////////////////////////////////////////////////////////////////
     
    14091729     delta = koeff(f,(M/ e)*p^l,(N/ e)*p^l*(eps-1)) / (-1*eps*c);
    14101730
    1411      if ((charstr(basering) != string(p)) and (delta != 0)) { 
     1731     if ((charstr(basering) != string(p)) and (delta != 0)) {
    14121732 //------ coefficient field is not Z/pZ => (p^l)th root is not identity -------
    14131733       delta=0;
     
    14371757USAGE:   reddevelop(f); f poly
    14381758RETURN:  Hamburger-Noether development of f :
    1439          A list of lists in the form of develop(f); each entry contains the 
     1759         A list of lists in the form of develop(f); each entry contains the
    14401760         data for one of the branches of f.
    14411761         For more details type 'help develop;'
     
    14961816    kill HNhelpring, getminpol;
    14971817   }
    1498    poly f=fetch(altring,f);
    1499 
     1818   if (nvars(altring)==2) { poly f=fetch(altring,f); }
     1819   else {
     1820     map m=altring,x,y;
     1821     poly f=m(f);
     1822     kill m;
     1823   }
    15001824 }
    15011825 export HNEring;
     
    15131837 //-------------------------- Test, ob Einheit oder Null ----------------------
    15141838 if (subst(subst(f,x,0),y,0)!=0) {
    1515    "The given polynomial is a unit!";
     1839   "The given polynomial is a unit in the power series ring!";
    15161840   keepring HNEring;
    15171841   return(list());                   // there are no HNEs
     
    15291853 //-------- Fall basering==0,... : Wechsel in Ring mit char >0 ----------------
    15301854 // weil squarefree eine Standardbasis berechnen muss (verwendet Syzygien)
    1531  // -- wenn f in diesem Ring quadratfrei ist, dann erst recht im Ring guenstig
     1855 // -- wenn f in diesem Ring quadratfrei ist, dann erst recht im Ring HNEring
    15321856 //----------------------------------------------------------------------------
    15331857  int testerg=(polytest(f)==0);
     
    15611885   }
    15621886   else {
    1563      if ((str=="s") and (testerg==1)) { 
     1887     if ((str=="s") and (testerg==1)) {
    15641888       "(*)attention: it could be that the factor is only one in char 32003!";
    15651889       f=polyhinueber(test_sqr);
     
    16221946 //====================== Ende Test auf Quadratfreiheit =======================
    16231947 if (subst(subst(f,x,0),y,0)!=0) {
    1624    "Sorry. The remaining polynomial is a unit...";
     1948   "Sorry. The remaining polynomial is a unit in the power series ring...";
    16251949   keepring HNEring;
    16261950   return(list());
    16271951 }
    16281952 //---------------------- Test, ob f teilbar durch x oder y -------------------
    1629  if (subst(f,y,0)==0) { 
     1953 if (subst(f,y,0)==0) {
    16301954   f=f/y; NullHNEy=1; }             // y=0 is a solution
    1631  if (subst(f,x,0)==0) { 
     1955 if (subst(f,x,0)==0) {
    16321956   f=f/x; NullHNEx=1; }             // x=0 is a solution
    16331957
     
    16852009 }
    16862010 if (NullHNEy==1) {
    1687   Ergebnis=Ergebnis+list(list(matrix(0),intvec(1),int(0),poly(0)));
     2011  Ergebnis=Ergebnis+list(list(matrix(ideal(0,x)),intvec(1),int(0),poly(0)));
    16882012 }
    16892013 // --------------- Berechne HNE von allen verbliebenen Zweigen: --------------
     
    17112035 }
    17122036 if (NullHNEx==1) {
    1713   Ergebnis=Ergebnis+list(list(matrix(0),intvec(1),int(1),poly(0)));
     2037  Ergebnis=Ergebnis+list(list(matrix(ideal(0,x)),intvec(1),int(1),poly(0)));
    17142038 }
    17152039 //------------------- Loesche globale, nicht mehr benoetigte Objekte: --------
     
    17282052}
    17292053example
    1730 { 
     2054{
    17312055  if (nameof(basering)=="HNEring") {
    17322056   def rettering=HNEring;
     
    18182142        if (N>1) { f = T1_Transform(f,delta,M/ e); }
    18192143        else     { ende=1; }
    1820         "a("+string(zeile)+","+string(Q)+") =",delta;
     2144        if (defined(Protokoll)) {"a("+string(zeile)+","+string(Q)+") =",delta;}
    18212145        azeilen=set_list(azeilen,intvec(zeile+1,Q),delta);
    18222146      }
     
    18272151 //------- vollziehe Euklid.Alg. nach, um die HN-Matrix zu berechnen: ---------
    18282152        while (R!=0) {
    1829          "h("+string(zeile)+") =",Q;
     2153         if (defined(Protokoll)) { "h("+string(zeile)+") =",Q; }
    18302154         hqs[zeile+1]=Q;  //denn zeile beginnt mit dem Wert 0
    18312155 //------------------ markiere das Zeilenende der HNE: ------------------------
     
    18362160         M=N; N=R; R=M%N; Q=M / N;
    18372161        }
    1838         "a("+string(zeile)+","+string(Q)+") =",delta;
     2162        if (defined(Protokoll)) {"a("+string(zeile)+","+string(Q)+") =",delta;}
    18392163        azeilen=set_list(azeilen,intvec(zeile+1,Q),delta);
    18402164      }
     
    19132237     if (charstr(basering)=="0,a") {
    19142238       faktoren,flag=extrafactor(leitf,M,N);  // damit funktion. Bsp. Baladi 5
     2239       if (flag==0)
     2240         { " ** I cannot proceed, will produce some error messages...";}
    19152241     }
    1916      else {flag=0;}
    1917      if (flag==0)
     2242     else
    19182243      {
    19192244 //------------------ faktorisiere das charakt. Polynom: ----------------------
     
    19322257        }
    19332258        else {
    1934           " Change of basering necessary!!";
    1935           teiler,"is not properly factored!";
    1936           if (needext==0) { poly zerlege=teiler; }
    1937           needext=1;
     2259          " Change of basering necessary!!";
     2260          if (defined(Protokoll)) { teiler,"is not properly factored!"; }
     2261          if (needext==0) { poly zerlege=teiler; }
     2262          needext=1;
    19382263        }
    19392264      }
    19402265     }                             // end(for j)
    19412266    }
    1942     else { deltais=delta; eis=e;}
     2267    else { deltais=ideal(delta); eis=e;}
    19432268    if (defined(Protokoll)) {"roots of char. poly:";deltais;
    1944                              "with multiplicities:",eis;}
     2269                             "with multiplicities:",eis;}
    19452270    if (needext==1) {
    19462271 //--------------------- fuehre den Ringwechsel aus: --------------------------
    19472272      ringischanged=1;
    19482273      if ((size(parstr(basering))>0) && string(minpoly)=="0") {
    1949         " ** We've had bad luck! The HNE cannot completely be calculated!";
    1950         ringischanged=0; break;    // weiter mit gefundenen Faktoren
     2274        " ** We've had bad luck! The HNE cannot completely be calculated!";
     2275                                   // HNE in transzendenter Erw. fehlgeschlagen
     2276        kill zerlege;
     2277        ringischanged=0; break;    // weiter mit gefundenen Faktoren
    19512278      }
    19522279      if (parstr(basering)=="") {
    1953         EXTHNEnumber++;
    1954         splitring(zerlege,"EXTHNEring("+string(EXTHNEnumber)+")");
    1955         poly transf=0;
    1956         poly transfproc=0;
     2280        EXTHNEnumber++;
     2281        splitring(zerlege,"EXTHNEring("+string(EXTHNEnumber)+")");
     2282        poly transf=0;
     2283        poly transfproc=0;
    19572284      }
    19582285      else {
    1959         if (defined(translist)) { kill translist; } // Vermeidung einer Warnung
    1960         if (numberofRingchanges>1) {  // ein Ringwechsel hat nicht gereicht
    1961         list translist=splitring(zerlege,"",list(transf,transfproc));
    1962         poly transf=translist[1]; poly transfproc=translist[2];
     2286        if (defined(translist)) { kill translist; } // Vermeidung einer Warnung
     2287        if (numberofRingchanges>1) {  // ein Ringwechsel hat nicht gereicht
     2288        list translist=splitring(zerlege,"",list(transf,transfproc));
     2289        poly transf=translist[1]; poly transfproc=translist[2];
    19632290        }
    19642291        else {
    1965         if (defined(transfproc)) { // in dieser proc geschah schon Ringwechsel
    1966           EXTHNEnumber++;
    1967           list translist=splitring(zerlege,"EXTHNEring("
     2292        if (defined(transfproc)) { // in dieser proc geschah schon Ringwechsel
     2293          EXTHNEnumber++;
     2294          list translist=splitring(zerlege,"EXTHNEring("
    19682295               +string(EXTHNEnumber)+")",list(a,transfproc));
    1969           poly transf=translist[1];
     2296          poly transf=translist[1];
    19702297          poly transfproc=translist[2];
    1971         }
    1972         else {
    1973           EXTHNEnumber++;
    1974           list translist=splitring(zerlege,"EXTHNEring("
     2298        }
     2299        else {
     2300          EXTHNEnumber++;
     2301          list translist=splitring(zerlege,"EXTHNEring("
    19752302               +string(EXTHNEnumber)+")",a);
    1976           poly transf=translist[1];
    1977           poly transfproc=transf;
    1978         }}
     2303          poly transf=translist[1];
     2304          poly transfproc=transf;
     2305        }}
    19792306      }
    19802307 //----------------------------------------------------------------------------
     
    20282355    if (R==0) {
    20292356      transformiert = T1_Transform(f,number(deltais[j]),M/ e);
    2030       "a("+string(zeile)+","+string(Q)+") =",deltais[j];
    2031       if (defined(Protokoll)) {"transformed polynomial: ",transformiert;}
     2357      if (defined(Protokoll)) {
     2358        "a("+string(zeile)+","+string(Q)+") =",deltais[j];
     2359        "transformed polynomial: ",transformiert;
     2360      }
    20322361      if (subst(transformiert,y,0)==0) {
    20332362       "finite HNE found";
     
    20402369                                  // aktualisiere Vektor mit den hqs
    20412370       if (eis[j]>1) {
    2042         transformiert=transformiert/y;
    2043         if (subst(transformiert,y,0)==0) {
     2371        transformiert=transformiert/y;
     2372        if (subst(transformiert,y,0)==0) {
    20442373 "THE TEST FOR SQUAREFREENESS WAS BAD!! The polynomial was NOT squarefree!!!";}
    2045         else {
     2374        else {
    20462375 //------ Spezialfall (###) eingetreten: Noch weitere Zweige vorhanden --------
    20472376          eis[j]=eis[j]-1;
    2048         }
     2377        }
    20492378       }
    20502379      }
     
    20712400       M1=M;N1=N;R1=R;Q1=M1/ N1;
    20722401       while (R1!=0) {
    2073         "h("+string(zeile+zl-2)+") =",Q1;
     2402        if (defined(Protokoll)) { "h("+string(zeile+zl-2)+") =",Q1; }
    20742403        HNEs=set_list(HNEs,intvec(hnezaehler,1,zeile+zl-1),Q1);
    20752404        HNEs=set_list(HNEs,intvec(hnezaehler,zeile+zl,Q1+1),x);
     
    20782407 //-------- Bereitstellung von Speicherplatz fuer eine neue Zeile: ------------
    20792408        HNEs=set_list(HNEs,intvec(hnezaehler,zeile+zl),ideal(0));
    2080                
     2409
    20812410        M1=N1; N1=R1; R1=M1%N1; Q1=M1 / N1;
    20822411       }
    2083        "a("+string(zeile+zl-2)+","+string(Q1)+") =",delta;
     2412       if (defined(Protokoll)) {
     2413         "a("+string(zeile+zl-2)+","+string(Q1)+") =",delta;
     2414       }
    20842415       hilfid=ideal(0);           // = HNEs[hnezaehler][zeile+zl];
    20852416       hilfid[Q1]=delta;hilfid[Q1+1]=x;
     
    21582489       M1=M;N1=N;R1=R;Q1=M1/ N1;
    21592490       while (R1!=0) {
    2160         "h("+string(zeile+zl-2)+") =",Q1;
     2491        if (defined(Protokoll)) { "h("+string(zeile+zl-2)+") =",Q1; }
    21612492        HNEs=set_list(HNEs,intvec(hnezaehler,1,zeile+zl-1),Q1);
    21622493        HNEs=set_list(HNEs,intvec(hnezaehler,zeile+zl,Q1+1),x);
     
    21672498        M1=N1; N1=R1; R1=M1%N1; Q1=M1 / N1;
    21682499       }
    2169        "a("+string(zeile+zl-2)+","+string(Q1)+") =",delta;
     2500       if (defined(Protokoll)) {
     2501         "a("+string(zeile+zl-2)+","+string(Q1)+") =",delta;
     2502       }
    21702503       HNEs=set_list(HNEs,intvec(hnezaehler,zeile+zl,Q1),delta);
    21712504
     
    22652598        testpol=0;
    22662599       }
    2267        if (testpol!=0) { "factorize not implemented in char (0,a)!";
    2268               "could not factorize",testpol; pause; }
    22692600      }
    22702601      if (a4==-625) {
     
    22752606         { faktoren=list(ideal(-4,y+1/25*a3,y-1/25*a3),intvec(1,1,1));
    22762607           testpol=0;}
    2277         if (testpol!=0) {"could not factorize:",charPoly(leitf,M,N); pause;}
    22782608      }
    2279  return(faktoren,defined(testpol)); // Test: faktoren==list() geht leider nicht
     2609      if (defined(testpol)==0) { poly testpol=1; }
     2610      if (testpol!=0) {
     2611        "factorize not implemented in char (0,a)!";
     2612        "could not factorize:",charPoly(leitf,M,N); pause;
     2613      }
     2614 return(faktoren,(testpol==0)); // Test: faktoren==list() geht leider nicht
    22802615}
    22812616example
     
    22902625  if (flag!=0) {factors;}
    22912626}
     2627
Note: See TracChangeset for help on using the changeset viewer.