Changeset 6c265b in git


Ignore:
Timestamp:
Sep 30, 2010, 8:07:01 PM (14 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b52fc4b2495505785981d640dcf7eb3e456778ef')
Children:
3576f6fb6a525ec1407b464179ffc8ad1f2c0ea7
Parents:
2433c5682fb607c4eeab2b77ea5d2c54269b493c
Message:
fix LIB includes

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

Legend:

Unmodified
Added
Removed
  • Singular/LIB/paraplanecurves.lib

    r2433c5 r6c265b  
    1010          F. Seelisch, seelisch@mathematik.uni-kl.de
    1111
    12 OVERVIEW: 
     12OVERVIEW:
    1313
    1414A library for computing rational parametrizations of rational plane curves
     
    2626and y as algebraic and computes an integral basis in C(x)[y] of the integral
    2727closure of C[x] in C(x,y) using the  normalization algorithm from
    28 @ref normal.lib: see @ref intbasis.lib. In a future edition of the library,
     28@ref normal.lib: see @ref integralbasis.lib. In a future edition of the library,
    2929also van Hoeij's algorithm for computing the integral basis will be
    3030available. @*
     
    3232Alternatively, the algorithm starts with a local analysis of the singular
    3333locus of C. Then, for each  primary component of the singular locus which
    34 does not correspond to ordinary multiple points or cusps, the integral 
     34does not correspond to ordinary multiple points or cusps, the integral
    3535basis algorithm is applied separately. The ordinary multiple points and
    36 cusps, in turn, are adressed by a straightforward direct algorithm. The 
    37 adjoint ideal is obtained by intersecting all ideals obtained locally. 
     36cusps, in turn, are adressed by a straightforward direct algorithm. The
     37adjoint ideal is obtained by intersecting all ideals obtained locally.
    3838The local variant of the algorithm is used by default. @*
    3939The linear system corresponding to the adjoint ideal maps the curve
     
    6262http://www.math.fsu.edu/~hoeij/papers/comments/jsc1994.html
    6363
    64 KEYWORDS: 
     64KEYWORDS:
    6565Curves; Parametrization; Rational curves; Adjoint ideal; Geometric genus
    6666
     
    8585paraConic(poly);                  Compute a rational parametrization of a conic
    8686testParametrization(poly,ring);   Checks whether a given curve is parametrized
    87                                   by a given rational map (defined in the 
     87                                  by a given rational map (defined in the
    8888                                  given ring)
    89 testPointConic(poly,ring);        Checks whether a given point (defined in the 
     89testPointConic(poly,ring);        Checks whether a given point (defined in the
    9090                                  given ring) lies on the given conic.
    9191";
     
    9898LIB "random.lib";
    9999LIB "homolog.lib";
    100 LIB "intbasis.lib";
     100LIB "integralbasis.lib";
    101101LIB "normal.lib";
    102102
     
    111111        not define a birational map.
    112112RETURN: ring, the coordinate ring of P, with an ideal
    113         named J and an ideal named psi. 
    114 @format The ideal J defines the image of phi.@* 
     113        named J and an ideal named psi.
     114@format The ideal J defines the image of phi.@*
    115115        The ideal psi gives the inverse of phi.@*
    116116        Note that the entries of psi should be considered as representatives
     
    127127   def Roriginal = basering;
    128128   int n = nvars(Roriginal);
    129    int m = size(phi);   
     129   int m = size(phi);
    130130   /*phi: P^(n-1) --> P^(m-1)*/
    131131   list rl = ringlist(Roriginal);
     
    133133   for(k = 1; k <= n; k++)
    134134     {
    135         rl[2][k] = "x("+string(k)+")";     
    136      }   
     135        rl[2][k] = "x("+string(k)+")";
     136     }
    137137   for(k = 1; k <= m; k++)
    138138     {
    139         rl[2][k+n] = "y("+string(k)+")";     
    140      } 
     139        rl[2][k+n] = "y("+string(k)+")";
     140     }
    141141   rl[3]= list(list("dp",1:(n+m)),list("C",0));
    142142   /*Use Hilbert driven Buchberger*/
     
    153153   intvec Hgraph = hilb(graph,1);
    154154   setring Roriginal;
    155    rl[3]= list(list("dp",1:n),list("dp",1:m),list("C",0)); 
     155   rl[3]= list(list("dp",1:n),list("dp",1:m),list("C",0));
    156156   def Rbig = ring(rl);
    157157   setring Rbig;
    158158   ideal graph = imap(Rbig0,graph);
    159    graph = std(graph,Hgraph); 
     159   graph = std(graph,Hgraph);
    160160   ideal xv = imap(Rbig0,xv);
    161161   /*The ideal J defines the image of phi*/
     
    163163   for(k = 1; k <= n; k++)
    164164     {
    165         J = subst(J,xv[k],0);     
    166      } 
     165        J = subst(J,xv[k],0);
     166     }
    167167   J = compress(J);
    168168   /*now we start inverting phi to psi*/
     
    170170   for(k = 1; k <= n; k++)
    171171     {
    172         relpsi = subst(relpsi,xv[k],0);     
    173      } 
     172        relpsi = subst(relpsi,xv[k],0);
     173     }
    174174    relpsi = compress(relpsi);
    175175    list rl = ringlist(Rbig);
     
    210210"USAGE:  checkAssumptions(f); f poly
    211211RETURN:  1 if assumptions are satisfied, 0 otherwise.@*
    212          Assumptions checked are: basering is polynomial ring in 3 variables 
     212         Assumptions checked are: basering is polynomial ring in 3 variables
    213213         with coefficients in Q, f is homogeneous and absolutely irreducible
    214214"
     
    216216  def Roriginal = basering;
    217217  list rl = ringlist(Roriginal);
    218   rl[3] = list(list("dp",1:3),list("C",0)); 
     218  rl[3] = list(list("dp",1:3),list("C",0));
    219219  if(size(rl[1])>1){ERROR("ground field is not Q");}
    220220  if(rl[1]!=0){ERROR("ground field is not Q");}
     
    224224  { ERROR("not a projective plane curve: polynomial is not homogeneous"); }
    225225  def RP2 = ring(rl);
    226   setring RP2;   
     226  setring RP2;
    227227  poly f = fetch(Roriginal,f);
    228   if(isIrreducible(f)==0){ERROR("curve is not absolutely irreducible");} 
     228  if(isIrreducible(f)==0){ERROR("curve is not absolutely irreducible");}
    229229  setring Roriginal;
    230230}
     
    233233proc paraPlaneCurve(poly f, list #)
    234234"USAGE:  paraPlaneCurve(f [,c]); f poly , c optional integer@*
    235          optional integer c can be: @*       
     235         optional integer c can be: @*
    236236         1: compute integral basis via normalization. @*
    237237         2: make local analysis of singularities first and apply normalization
     
    258258Alternatively, the algorithm starts with a local analysis of the singular
    259259locus of C. Then, for each  primary component of the singular locus which
    260 does not correspond to ordinary multiple points or cusps, the integral 
     260does not correspond to ordinary multiple points or cusps, the integral
    261261basis algorithm is applied separately. The ordinary multiple points and
    262 cusps, in turn, are adressed by a straightforward direct algorithm. The 
    263 adjoint ideal is obtained by intersecting all ideals obtained locally. 
     262cusps, in turn, are adressed by a straightforward direct algorithm. The
     263adjoint ideal is obtained by intersecting all ideals obtained locally.
    264264The local variant of the algorithm is used by default. @*
    265265The linear system corresponding to the adjoint ideal maps the curve
     
    275275EXAMPLE:  example paraPlaneCurve; shows an example
    276276"
    277 { 
    278   if(size(#)==0) {int choice = 2;} else {int choice = #[1];} 
    279   def Roriginal = basering; 
     277{
     278  if(size(#)==0) {int choice = 2;} else {int choice = #[1];}
     279  def Roriginal = basering;
    280280  /*checking assumptions and handling the conic case*/
    281281  checkAssumptions(f);
     
    284284  rl[3] = list(list("dp",1:3),list("C",0));
    285285  def RP2 = ring(rl);
    286   setring RP2;   
     286  setring RP2;
    287287  poly f = fetch(Roriginal,f);
    288288  int d = deg(f);
     
    298298      "//      setring RP1; PARA;";
    299299      return(RP1);
    300     } 
     300    }
    301301  int k;
    302   /*the adjoint ideal*/ 
    303   ideal AI = adjointIdeal(f,list(choice,"rattestyes/firstchecksdone")); 
     302  /*the adjoint ideal*/
     303  ideal AI = adjointIdeal(f,list(choice,"rattestyes/firstchecksdone"));
    304304  /*rattestyes -> causes error message if curve is not rational*/
    305305  /*firstchecksdone -> prevents that check of assumptions will be done again*/
     
    320320      for(k = 1; k <= m; k++)
    321321        {
    322           PROJ = subst(PROJ,var(k),AI[k]);     
     322          PROJ = subst(PROJ,var(k),AI[k]);
    323323        }
    324324      setring RP2;
     
    339339      "//      setring RP1; PARA;";
    340340      return(RP1);
    341     } 
     341    }
    342342  /*the even dimensional case*/
    343343  /*mapping the rational normal curve to a CONIC in P^2* creating PHI*/
    344344  def RP2conic = rncItProjEven(RNC);  // exports PHI, returns ring
    345345                                      // containing CONIC
    346   setring RP2conic; 
     346  setring RP2conic;
    347347  /*mapping the conic to P^1 via pencil defined by Ipoint*/
    348348  def RP2conicNew = projConic(CONIC);  // ring containing ideal Ipoint
     
    356356  for(k = 1; k <= 3; k++)
    357357    {
    358       PROJ = subst(PROJ,var(k),PHI[k]);     
    359     }   
     358      PROJ = subst(PROJ,var(k),PHI[k]);
     359    }
    360360  ideal AI = fetch(RP2,AI);
    361361  for(k = 1; k <= m; k++)
    362362    {
    363        PROJ = subst(PROJ,var(k+3),AI[k]);     
     363       PROJ = subst(PROJ,var(k+3),AI[k]);
    364364    }
    365365  setring RP2conicNew;
     
    367367  ideal PROJ = imap(Rbig,PROJ);
    368368  /*inverting the composed map to psi*/
    369   def rp1 = invertBirMap(PROJ,If); // (ring, (J,psi)) 
     369  def rp1 = invertBirMap(PROJ,If); // (ring, (J,psi))
    370370  setring rp1;
    371371  list rl1 = ringlist(rp1);
     
    394394  def Rp2 = paraPlaneCurve(f2);
    395395  setring Rp2;
    396   PARA; 
     396  PARA;
    397397}
    398398
     
    402402ASSUME:  The polynomial f is homogeneous in three variables, JAC is
    403403         the Jacobi ideal of f.
    404 RETURN:  intvec, say a,b,c. After the coordinate change 
     404RETURN:  intvec, say a,b,c. After the coordinate change
    405405         var(3) --> a*var(1)+b*var(2)+c*var(3), the curve {f=0}
    406406         has no singularities at infinity {var(3)=0}.
     
    421421                Jfinfty = JAC,a*var(1)+b*var(2)+c*var(3);
    422422                if(dim(std(Jfinfty)) == 0)
    423                   {                 
     423                  {
    424424                    return(a,b,c);
    425425                  }
     
    429429          }
    430430       h = h+1;
    431     } 
     431    }
    432432}
    433433
     
    459459Alternatively, the algorithm starts with a local analysis of the singular
    460460locus of C. Then, for each  primary component of the singular locus which
    461 does not correspond to ordinary multiple points or cusps, the integral 
     461does not correspond to ordinary multiple points or cusps, the integral
    462462basis algorithm is applied separately. The ordinary multiple points and
    463 cusps, in turn, are adressed by a straightforward direct algorithm. The 
    464 adjoint ideal is obtained by intersecting all ideals obtained locally. 
     463cusps, in turn, are adressed by a straightforward direct algorithm. The
     464adjoint ideal is obtained by intersecting all ideals obtained locally.
    465465The local variant of the algorithm is used by default. @*
    466466KEYWORDS: integral basis; normalization.
    467467EXAMPLE: example adjointIdeal; shows an example
    468468"
    469 { 
     469{
    470470  list choices = #;
    471471  if(size(#)==0)
     
    491491               choices = list(2, choices[1]);
    492492             }
    493         }   
    494     } 
     493        }
     494    }
    495495  if(size(#) == 2)
    496     {     
     496    {
    497497      if(not(find(choices[2],"firstchecksdone")))
    498498        {
    499499          checkAssumptions(f);
    500         } 
     500        }
    501501    }
    502502  ideal JAC = diff(maxideal(1),ideal(f));
     
    507507    {
    508508       bb1 = 1;
    509        int a,b,c  = findCoordChange(f,JAC); 
    510        f = subst(f,var(3),var(3)-a/c*var(1)-b/c*var(2));       
     509       int a,b,c  = findCoordChange(f,JAC);
     510       f = subst(f,var(3),var(3)-a/c*var(1)-b/c*var(2));
    511511    }
    512512  /*applying a change of coordinates if the point (0:1:0) lies on the curve*/
     
    514514  int bb2 = ((size(co)-1) != deg(f));
    515515  if(bb2)
    516     {   
     516    {
    517517       co = coeffs(f,var(1));
    518518       int bb2x = ((size(co)-1) == deg(f));
    519        if(bb2x) 
     519       if(bb2x)
    520520         {
    521521           map perm = basering, var(2), var(1), var(3);
     
    524524       else
    525525         {
    526            f = subst(f,var(1),var(1)+var(2)); 
    527          }           
     526           f = subst(f,var(1),var(1)+var(2));
     527         }
    528528    }
    529529  co = coeffs(f,var(2));
     
    534534  if(bb2)
    535535    {
    536        if(bb2x) 
     536       if(bb2x)
    537537         {
    538538           map perm = basering, var(2), var(1), var(3);
     
    541541       else
    542542         {
    543            AI = mstd(substitute(AI,var(1),var(1)-var(2)))[2]; 
    544          }             
    545      
     543           AI = mstd(substitute(AI,var(1),var(1)-var(2)))[2];
     544         }
     545
    546546    }
    547547  if(bb1==1)
     
    567567         2: make local analysis of singularities first and apply normalization
    568568            separately. @*
    569          The default is 2. @*       
     569         The default is 2. @*
    570570         string  may contain substring: @*
    571571         - rattestyes -> causes error message if curve is not rational. @*
     
    576576         as a polynomial in the second variable (that is, C does not contain
    577577         the point (0:1:0)).@*
    578          The curve C is not allowed to have singularities 
     578         The curve C is not allowed to have singularities
    579579         at infinity (z = 0). @*
    580580RETURN:  ideal, the adjoint ideal of the curve defined by f.
    581581"
    582 { 
    583   def Roriginal = basering; 
     582{
     583  def Roriginal = basering;
    584584  list rl = ringlist(Roriginal);
    585585  rl[3] = list(list("dp",1:nvars(Roriginal)),list("C",0));
    586   def RP2 = ring(rl);   
     586  def RP2 = ring(rl);
    587587  setring RP2;
    588588  poly f = imap(Roriginal,f);
     
    648648         A(OMP[k][1]) = intersect(A(OMP[k][1]), OMP[k][2]);
    649649       }
    650      int i = ub; 
     650     int i = ub;
    651651     setring RP2;
    652652     B = maxideal(n-i);
     
    655655     setring Rdummy;
    656656     B = imap(RP2,B);
    657      ideal A; 
     657     ideal A;
    658658     while(i>=lb)
    659         { 
     659        {
    660660          A = A(i)**(i-1);
    661661          B = intersect(B,A);
     
    685685        }
    686686    }
    687   list PD = primdecGTZ(SL);  // could be made faster -- see minAssGTZ 
     687  list PD = primdecGTZ(SL);  // could be made faster -- see minAssGTZ
    688688                             // in deltaLocMod -- only one PD needed
    689689  int pd = size(PD);
    690690  setring RP2;
    691691  B = imap(Rdummy,B);
    692   list PD = imap(Rdummy,PD); 
     692  list PD = imap(Rdummy,PD);
    693693  ideal AI = 1;
    694694  for(k=1;k<=pd;k++)
    695     { 
     695    {
    696696       AI = intersect(AI,adjointIdealIB(f,insert(choices,PD[k][1],
    697697                                                 size(choices))));
     
    707707///////////////////////////////////////////////////////////////////////////////
    708708static proc adjointIdealIB(poly f, list choices)
    709 "USAGE:  adjointIdealIB(f, choices); f polynomial in three variables, choices 
     709"USAGE:  adjointIdealIB(f, choices); f polynomial in three variables, choices
    710710         list consisting of one integer followed by one string followed by one
    711711         ideal. @*
     
    719719         with coefficients in Q. @*
    720720         The polynomial f must be homogeneous and absolutely irreducible.@*
    721          Its dehomogenization with respect to the third variable must be monic 
    722          as a polynomial in the second variable (that is, C does not contain 
     721         Its dehomogenization with respect to the third variable must be monic
     722         as a polynomial in the second variable (that is, C does not contain
    723723         the point (0:1:0)).@*
    724          The curve C is not allowed to have singularities 
     724         The curve C is not allowed to have singularities
    725725         at infinity (z = 0). @*
    726726RETURN:  ideal containing the adjoint ideal of the curve defined by f. @*
    727727"
    728 { 
     728{
    729729  poly dhf = subst(f,var(3),1);
    730730  def Roriginal = basering;
     
    743743  def Rred = ring(rl);   // make var(2) > var(1)
    744744  rl = ringlist(Rdummy);
    745   rl[1] = list(0,list(var(1)),list(list("dp",1)),ideal(0)); 
     745  rl[1] = list(0,list(var(1)),list(list("dp",1)),ideal(0));
    746746  rl[2] = list(var(2));
    747747  rl[3] = list(list("dp",1),list("C",0));
     
    751751    {
    752752      LIntB = integralBasis(f, 2, list(list("inputC", DATA[3]),"isIrred"));
    753     } 
     753    }
    754754  else                                 // use van Hoeij's algorithm
    755     {     
     755    {
    756756      LIntB = integralBasisVH(f,DATA[3],2);  // van Hoeij in future version
    757757    }
     
    760760      setring Roriginal;
    761761      int gg = geomGenusIB(f,imap(Rdummy, LIntB));
    762       if(gg!=0){ERROR("not a rational curve");} 
     762      if(gg!=0){ERROR("not a rational curve");}
    763763      setring Rdummy;
    764764    }
     
    776776  poly d = imap(Rdummy,d);
    777777  M=1/d*M;
    778   list LUM = ludecomp(M); 
    779   list LS; 
     778  list LUM = ludecomp(M);
     779  list LS;
    780780  matrix dummyvector[sL][1];
    781781  matrix Gij[sL][sL];
     
    788788     {
    789789       for(j = i; j <= sL; j++)
    790           {   
     790          {
    791791            setring Rred;
    792             Gij = 0;       
    793             eiej = IB[i]*IB[j]; 
     792            Gij = 0;
     793            eiej = IB[i]*IB[j];
    794794            Iij=empty;
    795795            for(k = 1; k <= sL; k++)
    796796               {
    797797                  Iij[k] = reduce(eiej*IB[k],fred);
    798                } 
    799             Gij = coeffs(ideal(Iij[1..sL]),var(1)); 
     798               }
     799            Gij = coeffs(ideal(Iij[1..sL]),var(1));
    800800            setring QF;
    801             Gij = imap (Rred, Gij); 
    802             for(k = 1; k <= sL; k++) 
     801            Gij = imap (Rred, Gij);
     802            for(k = 1; k <= sL; k++)
    803803               {
    804804                  dummyvector = Gij[1..sL,k];
    805                   LS = lusolve(LUM[1], LUM[2], LUM[3], dummyvector);                   
     805                  LS = lusolve(LUM[1], LUM[2], LUM[3], dummyvector);
    806806                  Tr[i,j] = Tr[i,j] + 1/d^3*LS[2][k,1];
    807                }               
     807               }
    808808          }
    809809     }
     
    811811     {
    812812       for(j = 1; j < i; j++)
    813           { 
     813          {
    814814             Tr[i,j] = Tr[j,i];
    815           } 
    816      } 
    817   LUM = ludecomp(Tr); 
     815          }
     816     }
     817  LUM = ludecomp(Tr);
    818818  setring Rred;
    819819  poly d2f = imap(Rdummy,d2f);
     
    840840EXAMPLE: example mapToRatNormCurve; shows an example
    841841"
    842 { 
     842{
    843843   int n = size(AI);
    844844   int k;
     
    846846   def Roriginal = basering;
    847847   ideal IC = f;
    848    list rl = ringlist(Roriginal);   
     848   list rl = ringlist(Roriginal);
    849849   /* begin workaround elimination*/
    850850   for(k = 1; k <= 3; k++)
    851851     {
    852         rl[2][k] = "x("+string(k)+")";     
    853      }   
     852        rl[2][k] = "x("+string(k)+")";
     853     }
    854854   for(k = 1; k <= n; k++)
    855855     {
    856         rl[2][k+3] = "y("+string(k)+")";     
    857      } 
     856        rl[2][k+3] = "y("+string(k)+")";
     857     }
    858858   rl[3]= list(list("dp",1:(3+n)),list("C",0));
    859859   def Relim = ring(rl);
     
    861861   ideal IC = fetch(Roriginal,IC);
    862862   ideal AI = fetch(Roriginal,AI);
    863    ideal J; 
     863   ideal J;
    864864   J = IC;
    865865   for(k=1;k<=n;k++)
     
    899899///////////////////////////////////////////////////////////////////////////////
    900900proc rncAntiCanonicalMap(ideal I)
    901 "USAGE:  rncAntiCanonicalMap(I); I ideal 
     901"USAGE:  rncAntiCanonicalMap(I); I ideal
    902902ASSUME:  I is a homogeneous ideal in the basering
    903903         defining a rational normal curve C in PP^n.
    904 NOTE:   The procedure will fail or give a wrong output if I is not the 
     904NOTE:   The procedure will fail or give a wrong output if I is not the
    905905        ideal of a rational normal curve.
    906906RETURN:  ideal defining the anticanonical map  C --> PP^(n-2). @*
    907          Note that the entries of the ideal should be considered as 
     907         Note that the entries of the ideal should be considered as
    908908         representatives of elements in R/I, where R is the basering.
    909 THEORY:  The anti-canonical map of a rational normal curve 
     909THEORY:  The anti-canonical map of a rational normal curve
    910910         maps C isomorpically to a rational normal curve in PP^(n-2).
    911911KEYWORDS: rational normal curve, projection.
    912912EXAMPLE: example rncAntiCanonicalMap; shows an example
    913913"
    914 { 
     914{
    915915  def Roriginal = basering;
    916916  list rl = ringlist(Roriginal);
    917917  rl[3] = list(list("dp",1:nvars(Roriginal)),list("C",0));
    918   def RoriginalDP = ring(rl); 
     918  def RoriginalDP = ring(rl);
    919919  setring RoriginalDP;
    920920  ideal I = imap(Roriginal,I);
     
    943943///////////////////////////////////////////////////////////////////////////////
    944944proc rncItProjOdd(ideal I)
    945 "USAGE:  rncItProjOdd(I); I ideal 
     945"USAGE:  rncItProjOdd(I); I ideal
    946946ASSUME:  I is a homogeneous ideal in the basering
    947947         with n+1 variables defining a rational normal curve C in PP^n with n
     
    950950         ideal of a rational normal curve. It will test whether n is odd.
    951951RETURN:  ideal PHI defining an isomorphic projection of C to PP^1.@*
    952          Note that the entries of PHI should be considered as 
     952         Note that the entries of PHI should be considered as
    953953         representatives of elements in R/I, where R is the basering.
    954954THEORY:  We iterate the procedure @ref rncAntiCanonicalMap to obtain PHI.
     
    957957EXAMPLE: example rncItProjOdd; shows an example
    958958"
    959 { 
     959{
    960960  int n = nvars(basering);
    961961  if((n mod 2) == 1){ERROR("Pn has even dimension");}
    962   def Roriginal = basering; 
     962  def Roriginal = basering;
    963963  list rlo = ringlist(Roriginal);
    964964  rlo[3]= list(list("dp",1:n),list("C",0));
     
    966966  for(k = 1; k <= n; k++)
    967967    {
    968       rlo[2][k] = "z("+string(k)+")";     
    969     } 
     968      rlo[2][k] = "z("+string(k)+")";
     969    }
    970970  def RoriginalCopy = ring(rlo);
    971971  for(k = 1; k <= n; k++)
    972972    {
    973       rlo[2][k] = "y("+string(k)+")";     
    974     } 
     973      rlo[2][k] = "y("+string(k)+")";
     974    }
    975975  def Rold = ring(rlo);
    976976  setring RoriginalCopy;
     
    984984  intvec HJJ;
    985985  while(n>2)
    986      {       
     986     {
    987987        ideal PR = rncAntiCanonicalMap(J);
    988988        list rl = ringlist(Rold);
     
    993993        for(k = 1; k <= n; k++)
    994994          {
    995              dummy = subst(dummy,var(k),PHI[k]);     
    996           } 
     995             dummy = subst(dummy,var(k),PHI[k]);
     996          }
    997997        setring RoriginalCopy;
    998998        PHI = imap(Rbig,dummy);
     
    10011001        for(k = 1; k <= n; k++)
    10021002          {
    1003             rl[2][k] = "x("+string(k)+")";     
    1004           }   
     1003            rl[2][k] = "x("+string(k)+")";
     1004          }
    10051005        for(k = 1; k <= n-2; k++)
    10061006          {
    1007             rl[2][k+n] = "y("+string(k)+")";     
    1008           } 
     1007            rl[2][k+n] = "y("+string(k)+")";
     1008          }
    10091009        rl[3]= list(list("dp",1:(2*n-2)),list("C",0));
    10101010        Relim = ring(rl);
     
    10161016        for(k = 1; k <= n; k++)
    10171017          {
    1018             pvar = pvar*var(k);     
    1019           }   
     1018            pvar = pvar*var(k);
     1019          }
    10201020        for(k=1;k<=n-2;k++)
    10211021          {
     
    10581058///////////////////////////////////////////////////////////////////////////////
    10591059proc rncItProjEven(ideal I)
    1060 "USAGE:  rncItProjEven(I); I ideal 
     1060"USAGE:  rncItProjEven(I); I ideal
    10611061ASSUME:  I is a homogeneous ideal in the basering
    10621062         with n+1 variables defining a rational normal curve C in PP^n with n
    10631063         even.
    1064 NOTE:    The procedure will fail or give a wrong output if I is not the 
     1064NOTE:    The procedure will fail or give a wrong output if I is not the
    10651065         ideal of a rational normal curve. It will test whether n is odd.
    10661066RETURN:  ring with an ideal CONIC defining a conic C2 in PP^2. In addition,
    10671067         an ideal PHI in the basering defining an isomorphic projection
    10681068         of C to C2 will be exported.@*
    1069          Note that the entries of PHI should be considered as 
     1069         Note that the entries of PHI should be considered as
    10701070         representatives of elements in R/I, where R is the basering.
    10711071THEORY:  We iterate the procedure @ref rncAntiCanonicalMap to obtain PHI.
     
    10741074EXAMPLE: example rncItProjEven; shows an example
    10751075"
    1076 { 
     1076{
    10771077  int n = nvars(basering);
    10781078  if((n mod 2) == 0){ERROR("Pn has odd dimension");}
    1079   def Roriginal = basering; 
     1079  def Roriginal = basering;
    10801080  list rlo = ringlist(Roriginal);
    10811081  rlo[3]= list(list("dp",1:n),list("C",0));
     
    10831083  for(k = 1; k <= n; k++)
    10841084    {
    1085       rlo[2][k] = "z("+string(k)+")";     
    1086     } 
     1085      rlo[2][k] = "z("+string(k)+")";
     1086    }
    10871087  def RoriginalCopy = ring(rlo);
    10881088  for(k = 1; k <= n; k++)
    10891089    {
    1090       rlo[2][k] = "y("+string(k)+")";     
    1091     } 
     1090      rlo[2][k] = "y("+string(k)+")";
     1091    }
    10921092  def Rold = ring(rlo);
    10931093  setring RoriginalCopy;
     
    11011101  intvec HJJ;
    11021102  while(n>3)
    1103      {       
     1103     {
    11041104        ideal PR = rncAntiCanonicalMap(J);
    11051105        list rl = ringlist(Rold);
     
    11101110        for(k = 1; k <= n; k++)
    11111111          {
    1112              dummy = subst(dummy,var(k),PHI[k]);     
    1113           } 
     1112             dummy = subst(dummy,var(k),PHI[k]);
     1113          }
    11141114        setring RoriginalCopy;
    11151115        PHI = imap(Rbig,dummy);
     
    11181118        for(k = 1; k <= n; k++)
    11191119          {
    1120             rl[2][k] = "x("+string(k)+")";     
    1121           }   
     1120            rl[2][k] = "x("+string(k)+")";
     1121          }
    11221122        for(k = 1; k <= n-2; k++)
    11231123          {
    1124             rl[2][k+n] = "y("+string(k)+")";     
    1125           } 
     1124            rl[2][k+n] = "y("+string(k)+")";
     1125          }
    11261126        rl[3]= list(list("dp",1:(2*n-2)),list("C",0));
    11271127        Relim = ring(rl);
     
    11331133        for(k = 1; k <= n; k++)
    11341134          {
    1135             pvar = pvar*var(k);     
    1136           }   
     1135            pvar = pvar*var(k);
     1136          }
    11371137        for(k=1;k<=n-2;k++)
    11381138          {
     
    11521152        Rold = Rnew;
    11531153        setring Rold;
    1154         n = n-2; 
     1154        n = n-2;
    11551155     }
    11561156  poly CONIC = J[1];
     
    11831183         with coefficients in Q. @*
    11841184         The polynomial f must be homogeneous and absolutely irreducible.@*
    1185          Its dehomogenization with respect to the third variable must be monic 
     1185         Its dehomogenization with respect to the third variable must be monic
    11861186         as a polynomial in the second variable (that is, the curve C = {f = 0}
    11871187         does not contain the point (0:1:0)).@*
    1188          The curve C is not allowed to have singularities 
     1188         The curve C is not allowed to have singularities
    11891189         at infinity (z = 0). @*
    11901190NOTE:    The last two conditions can be met by a suitable change of coordinates in PGL(3)
     
    11971197SEE ALSO: genus.
    11981198"
    1199 { 
     1199{
    12001200  int bb = size(#);
    12011201  poly dhf = subst(f,var(3),1);
     
    12101210  if(bb == 0)
    12111211    {
    1212       LIntB = integralBasis(f,2,"isIrred");     
     1212      LIntB = integralBasis(f,2,"isIrred");
    12131213    }
    12141214  else
     
    12241224  for(k = 1; k <= sL; k++)
    12251225     {
    1226         gg = gg + deg(gcd(d,IB[k]));     
     1226        gg = gg + deg(gcd(d,IB[k]));
    12271227     }
    12281228  setring Roriginal;
     
    12571257SEE ALSO: genus
    12581258"
    1259 {   
     1259{
    12601260   int w = printlevel-voice+2;  // w=printlevel (default: w=0)
    12611261   int d = deg(F);
     
    12681268   int delt,deltaloc,deltainf,tau,tauinf,cusps,iloc,iglob,l,nsing,
    12691269       tauloc,tausing,k,rat,nbranchinf,nbranch,nodes,cuspsinf,nodesinf;
    1270    list inv; 
     1270   list inv;
    12711271   execute("ring newR=("+charstr(R)+"),(x,y),dp;");
    12721272   //the singularities at the affine part
     
    12741274   ideal I=sigma(F);
    12751275
    1276    list OMPButNodes; 
    1277    int sizeOMPButNodes;   
    1278    int NotOnlyOMPPlusCusps; 
     1276   list OMPButNodes;
     1277   int sizeOMPButNodes;
     1278   int NotOnlyOMPPlusCusps;
    12791279
    12801280   ideal I1=jacob(I);
     
    13151315
    13161316   ideal NodesPlusCusps  = radical(sat(I+I1, radIDsing)[1]);
    1317  
     1317
    13181318   nsing=nsing+cusps;
    13191319
     
    13481348          delt=delt+nodes+cusps;
    13491349          if((w>=1)&&(inv[2]==0)){"smooth at (0,0,1)";}
    1350           if(inv[4]!=0) 
     1350          if(inv[4]!=0)
    13511351            {
    13521352              OMPButNodes = insert(OMPButNodes,list(inv[4],maxideal(1)),
     
    13561356          else
    13571357            {
    1358               NotOnlyOMPPlusCusps = NotOnlyOMPPlusCusps + 1; 
     1358              NotOnlyOMPPlusCusps = NotOnlyOMPPlusCusps + 1;
    13591359            }
    13601360        }
     
    13721372              tausing=tausing+inv[2];
    13731373              nbranch=nbranch+inv[3];
    1374               if(inv[4]!=0) 
     1374              if(inv[4]!=0)
    13751375                {
    13761376                  OMPButNodes = insert(OMPButNodes,list(inv[4],pr[k]),
    13771377                                       sizeOMPButNodes);
    1378                   sizeOMPButNodes = size(OMPButNodes); 
     1378                  sizeOMPButNodes = size(OMPButNodes);
    13791379                }
    13801380              else
    13811381                {
    1382                   NotOnlyOMPPlusCusps = NotOnlyOMPPlusCusps + 1; 
     1382                  NotOnlyOMPPlusCusps = NotOnlyOMPPlusCusps + 1;
    13831383                }
    13841384           }
     
    14081408   }
    14091409   setring R;
    1410    if(sizeOMPButNodes>0) 
     1410   if(sizeOMPButNodes>0)
    14111411     {
    1412        list OMPButNodes = fetch(newR,OMPButNodes);   
     1412       list OMPButNodes = fetch(newR,OMPButNodes);
    14131413     }
    14141414   return(list(genus,NotOnlyOMPPlusCusps,OMPButNodes,
     
    15291529      }
    15301530   }
    1531    int intMult = deg(lead(f)); 
    1532    poly fdummy = f; 
    1533    poly gdummy = lead(f); 
    1534    int ivr = 1; 
    1535    while(ivr) 
     1531   int intMult = deg(lead(f));
     1532   poly fdummy = f;
     1533   poly gdummy = lead(f);
     1534   int ivr = 1;
     1535   while(ivr)
    15361536      {
    15371537        fdummy = fdummy - lead(fdummy);
    15381538        if((fdummy ==0) || (deg(lead(fdummy))>intMult)){break;}
    1539         gdummy = gdummy + lead(fdummy); 
     1539        gdummy = gdummy + lead(fdummy);
    15401540      }
    1541    ideal SQRpart = sqrfree(gdummy); 
     1541   ideal SQRpart = sqrfree(gdummy);
    15421542   int IntForRet;  ///neu
    1543    if(deg(SQRpart[1])==intMult) 
     1543   if(deg(SQRpart[1])==intMult)
    15441544     {
    1545         IntForRet = intMult;   
     1545        IntForRet = intMult;
    15461546     }
    15471547   option(noredSB);
     
    16641664proc paraConic(poly q)
    16651665"USAGE:  paraConic(q); q poly
    1666 ASSUME:  The basering must be a polynomial ring in three variables with 
     1666ASSUME:  The basering must be a polynomial ring in three variables with
    16671667         coefficients in Q. @*
    16681668         The polynomial q must be homogeneous of degree 2 and absolutely
     
    16881688EXAMPLE: example paraConic; shows an example
    16891689"
    1690 {   
     1690{
    16911691  def Roriginal = basering;
    16921692  def RP2 = projConic(q);  // ring with ideal Ipoint
     
    16991699  def RP1 = ring(rl);
    17001700  setring RP1;
    1701   ideal PARACONIC = fetch(rp1,psi); 
     1701  ideal PARACONIC = fetch(rp1,psi);
    17021702  export(PARACONIC);
    17031703  "// 'paraConic' created a ring together with an ideal RNC.";
     
    17271727static proc projConic(poly q)
    17281728"USAGE:  projConic(q); q poly
    1729 ASSUME:  The basering must be a polynomial ring in three variables with 
     1729ASSUME:  The basering must be a polynomial ring in three variables with
    17301730         coefficients in Q. @*
    17311731         The polynomial q must be homogeneous of degree 2 and absolutely
     
    17401740SEE ALSO: rationalPointConic.
    17411741"
    1742 { 
     1742{
    17431743  def Roriginal = basering;
    17441744  list rl = ringlist(Roriginal);
     
    17511751                                     //  possibly defined over algebraic number
    17521752                                     //  field
    1753   setring RP21; 
     1753  setring RP21;
    17541754  list rl1 = ringlist(RP21);
    1755   rl1[2] = list("u","v","w"); 
     1755  rl1[2] = list("u","v","w");
    17561756  rl1[3] = list(list("dp",1:3),list("C",0));
    1757   def RP2 = ring(rl1); 
     1757  def RP2 = ring(rl1);
    17581758  setring RP2;
    17591759  ideal point = fetch(RP21,point);
     
    21892189  if ((b mod a) == 0) { l = a, 1, 0; if (a < 0) { l = -a, -1, 0; }; }
    21902190  if (size(l) > 1) { return (l); }
    2191                
     2191
    21922192  temp = a mod b;
    21932193  l = extendedEuclid(b, temp);
     
    25352535}
    25362536///////////////////////////////////////////////////////////////////////////////
    2537 proc testParametrization(poly f, def rTT) 
     2537proc testParametrization(poly f, def rTT)
    25382538"USAGE:  testParametrization(f,rTT); f poly, rTT ring
    2539 ASSUME:  The assumptions on the basering and the polynomial f are as required 
    2540          by @ref paraPlaneCurve. The ring rTT has two variables and contains 
     2539ASSUME:  The assumptions on the basering and the polynomial f are as required
     2540         by @ref paraPlaneCurve. The ring rTT has two variables and contains
    25412541         an ideal PARA (such as the ring obtained by applying
    2542          @ref paraPlaneCurve to f). 
    2543 RETURN: int which is 1 if PARA defines a parametrization of the curve 
     2542         @ref paraPlaneCurve to f).
     2543RETURN: int which is 1 if PARA defines a parametrization of the curve
    25442544        {f=0} and 0, otherwise.
    25452545THEORY: We compute the image of PARA and compare it with f.
     
    25582558  setring Relim;
    25592559  ideal PARA = fetch(rTT,PARA);
    2560   ideal JJ; 
     2560  ideal JJ;
    25612561  for(k=1;k<=3;k++)
    25622562     {
     
    25782578  g = reduce(ftest[1],std(ideal(f)));
    25792579  if(g!=0){return(0)};
    2580   return (1); 
     2580  return (1);
    25812581}
    25822582
     
    27352735adjointIdeal(f,2);
    27362736def RP1 = paraPlaneCurve(f);  // time 0
    2737 testParametrization(f,RP1); 
     2737testParametrization(f,RP1);
    27382738setring RP1; PARA;
    27392739kill RR;kill RP1;
     
    27972797// -------------------------------------------------------
    27982798ring SS = 0, (u,v,z), dp;
    2799 poly f = 
     2799poly f =
    280028002*u^7+u^6*v+3*u^5*v^2+u^4*v^3+2*u^3*v^4+u^2*v^5+2*u*v^6+v^7
    28012801-7780247/995328*u^6*z-78641/9216*u^5*v*z-10892131/995328*u^4*v^2*z
     
    28362836adjointIdeal(f,2);
    28372837def RP1 = paraPlaneCurve(f);  // time 72
    2838 testParametrization(f,RP1); 
     2838testParametrization(f,RP1);
    28392839setring RP1; PARA;
    28402840kill SS;kill RP1;
Note: See TracChangeset for help on using the changeset viewer.