Changeset e1fdcd in git for Singular/LIB/normal.lib


Ignore:
Timestamp:
May 20, 2010, 6:03:06 PM (14 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
dd4942c513f746e8c0cbbd433a4310c9fbb756ea
Parents:
c12222e2ab738f967d4dd4a6e28afd75114c4cf7
Message:
extended version for intBasis.lib

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

Legend:

Unmodified
Added
Removed
  • Singular/LIB/normal.lib

    rc12222 re1fdcd  
    6464         - \"withDelta\" (or \"wd\") -> returns also the delta invariants.@*
    6565         If the optional parameter choose is not given or empty, only
    66          \"equidim\" but no other option is used.
     66         \"equidim\" but no other option is used.@*
     67         The following options can be used when the ring has two variables.
     68         They are needed for computing integral basis.@*
     69         - \"var1\" -> uses a polynomial in the first variable as conductor.@*
     70         - \"var2\" -> uses a polynomial in the second variable as conductor.@*
    6771ASSUME:  The ideal must be radical, for non-radical ideals the output may
    6872         be wrong (id=radical(id); makes id radical). However, when using the
     
    125129"
    126130{
    127    intvec opt = option(get);     // Save current options
     131  intvec opt = option(get);     // Save current options
    128132
    129133  int i,j;
     
    138142  int nvar = nvars(basering);
    139143  int chara  = char(basering);
    140   list result;
     144  int conduOption;   // Method for choosing the conductor
     145  list result, resultNew;
    141146  list keepresult;
    142147  list ringStruc;
     
    196201    }
    197202  }
     203
     204  conduOption = 0;     // The default is the smallest degree polynomial
     205  if ( find(method,"var1") )
     206  {conduOption = 1;}
     207  if ( find(method,"var2") )
     208  {conduOption = 2;}
     209
    198210
    199211  kill #;
     
    238250    def ROut = ring(lR);
    239251    setring ROut;
    240     ideal norid = 0;
     252    ideal norid = fetch(origR, id);
    241253    ideal normap = maxideal(1);
    242254    export norid;
     
    245257    if(withDelta)
    246258    {
    247       result = list(list(ideal(1), poly(1), ROut), 0);
     259      result = list(list(ROut), list(ideal(1)), list(intvec(0), 0));
    248260    }
    249261    else
    250262    {
    251       result = list(list(ideal(1), poly(1), ROut));
    252     }
     263      result = list(list(ROut), list(ideal(1)));
     264    }
     265    sp = 1;      // number of rings in the output
     266    option(set, opt);
     267    normalOutputText(dbg, withDelta, sp);
    253268    return(result);
    254269  }
    255 
    256270//------------------------ preliminary decomposition-----------------------
    257271  list prim;
     
    330344      }
    331345      printlevel = printlevel + 1;
    332       norComp = normalM(prim[i], decomp, withDelta);
     346      norComp = normalM(prim[i], decomp, withDelta, conduOption);
    333347      printlevel = printlevel - 1;
    334348      for(j = 1; j <= size(norComp); j++)
     
    434448    }
    435449  }
    436   list resultNew;
    437 
    438450  if(withDelta)
    439451  {
     
    444456    resultNew = list(RL, MG);
    445457  }
    446 
    447458  sp = size(RL);              //RL = list of rings
     459
    448460  option(set, opt);
    449 
     461  normalOutputText(dbg, withDelta, sp);
     462  return(resultNew);
     463}
     464
     465example
     466{ "EXAMPLE:";
     467  printlevel = printlevel+1;
     468  echo = 2;
     469  ring s = 0,(x,y),dp;
     470  ideal i = (x2-y3)*(x2+y2)*x;
     471  list nor = normal(i, "withDelta", "prim");
     472  nor;
     473
     474  // 2 branches have delta = 1, and 1 branch has delta = 0
     475  // the total delta invariant is 13
     476
     477  def R2 = nor[1][2];  setring R2;
     478  norid; normap;
     479
     480  echo = 0;
     481  printlevel = printlevel-1;
     482  pause("   hit return to continue"); echo=2;
     483
     484  ring r = 2,(x,y,z),dp;
     485  ideal i = z3-xy4;
     486  list nor = normal(i, "withDelta", "prim");  nor;
     487  // the delta invariant is infinite
     488  // xy2z/z2 and xy3/z2 generate the integral closure of r/i as r/i-module
     489  // in its quotient field Quot(r/i)
     490
     491  // the normalization as affine algebra over the ground field:
     492  def R = nor[1][1]; setring R;
     493  norid; normap;
     494}
     495
     496///////////////////////////////////////////////////////////////////////////////
     497// Prints the output text in proc normal.
     498//
     499static proc normalOutputText(int dbg, int withDelta, int sp)
     500// int dbg: printlevel
     501// int withDelta: output contains information about the delta invariant
     502// int sp: number of output rings.
     503{
    450504  if ( dbg >= 0 )
    451505  {
     
    484538    }
    485539  }
    486   return(resultNew);
    487540}
    488541
    489 example
    490 { "EXAMPLE:";
    491   printlevel = printlevel+1;
    492   echo = 2;
    493   ring s = 0,(x,y),dp;
    494   ideal i = (x2-y3)*(x2+y2)*x;
    495   list nor = normal(i, "withDelta", "prim");
    496   nor;
    497 
    498   // 2 branches have delta = 1, and 1 branch has delta = 0
    499   // the total delta invariant is 13
    500 
    501   def R2 = nor[1][2];  setring R2;
    502   norid; normap;
    503 
    504   echo = 0;
    505   printlevel = printlevel-1;
    506   pause("   hit return to continue"); echo=2;
    507 
    508   ring r = 2,(x,y,z),dp;
    509   ideal i = z3-xy4;
    510   list nor = normal(i, "withDelta", "prim");  nor;
    511   // the delta invariant is infinite
    512   // xy2z/z2 and xy3/z2 generate the integral closure of r/i as r/i-module
    513   // in its quotient field Quot(r/i)
    514 
    515   // the normalization as affine algebra over the ground field:
    516   def R = nor[1][1]; setring R;
    517   norid; normap;
    518 }
    519542
    520543///////////////////////////////////////////////////////////////////////////////
     
    35233546           if(noRed == 0){
    35243547             resu = list(computeRing(II,prim[i])) + resu;
    3525            } else {
     3548           }
     3549           else
     3550           {
    35263551             resu = list(computeRing(II,prim[i], "noRed")) + resu;
    35273552           }
     
    39323957      setring R;
    39333958      return(R1);
    3934     } else {
     3959    }
     3960    else
     3961    {
    39353962      list L = substpartSpecial(norid,normap);
    39363963      def lastRing = L[1];
     
    40414068        A = lift(pf, ff, u);
    40424069        Quad = Quad,ideal(newT[jj-1]*newT[ii-1] * u[1, 1]- T*A);
    4043       } else {
     4070      }
     4071      else
     4072      {
    40444073        A = lift(pf,ff);              // ff lin. comb. of elts of pf mod I
    40454074        Quad = Quad,ideal(newT[jj-1]*newT[ii-1] - T*A);
     
    40834112    }
    40844113    return(lastRing);
    4085   } else {
     4114  }
     4115  else
     4116  {
    40864117    ideal norid = endid;
    40874118    ideal normap = endphi;
     
    40994130//                From here: subprocedures for normal
    41004131
    4101 static proc normalM(ideal I, int decomp, int withDelta){
     4132static proc normalM(ideal I, int decomp, int withDelta, int conduOption){
    41024133// Computes the normalization of a ring R / I using the module structure as far
    41034134// as possible.
     
    41374168// decomp = 3 (meaning that the ideal is prime).
    41384169
     4170// conduOption = 0      -> Uses the smallest degree polynomial
     4171// conduOption = i > 0  -> Uses a polynomial in the i-th variable
     4172
    41394173  option("redSB");
    41404174  option("returnSB");
     
    41534187    I = IM[1];
    41544188    ideal IMin = IM[2];   // A minimal set of generators in the groebner basis.
    4155   } else {
     4189  }
     4190  else
     4191  {
    41564192    // The minimal set of generators is not computed by mstd for
    41574193    // non-global orderings.
     
    41914227    if(withDelta){
    41924228      list output = ideal(1), poly(1), ROut, 0;
    4193     } else {
     4229    }
     4230    else
     4231    {
    41944232      list output = ideal(1), poly(1), ROut;
    41954233    }
     
    41994237
    42004238  // -------------------- election of the conductor -------------------------
    4201   poly condu = getSmallest(J);   // Choses the polynomial of smallest degree
    4202                                  // of J as universal denominator.
     4239  if(conduOption == 0){
     4240    poly condu = getSmallest(J);   // Choses the polynomial of smallest degree
     4241                                   // of J as universal denominator.
     4242  }
     4243  else
     4244  {
     4245    poly condu = getOnevar(J, conduOption);
     4246  }
    42034247  if(dbg >= 1){
    42044248    "";
     
    42234267      // I = I1 \cap I2
    42244268      printlevel = printlevel + 1;
    4225       list nor1 = normalM(Id1, decomp, withDelta)[1];
    4226       list nor2 = normalM(Id2, decomp, withDelta)[1];
     4269      list nor1 = normalM(Id1, decomp, withDelta, conduOption)[1];
     4270      list nor2 = normalM(Id2, decomp, withDelta, conduOption)[1];
    42274271      printlevel = printlevel - 1;
    42284272      return(list(nor1, nor2));
     
    42494293    if(locAtZero(J)){
    42504294      J = maxideal(1);
    4251     } else {
     4295    }
     4296    else
     4297    {
    42524298      J = radical(J);
    42534299    }
    4254   } else {
     4300  }
     4301  else
     4302  {
    42554303    // We change to global dp ordering.
    42564304    list rl = ringlist(R);
     
    42844332  J = fetch(R, J);
    42854333  J = interred(J);
    4286   poly D = getSmallest(J);    // Chooses the polynomial of smallest degree as
    4287                               // non-zerodivisor.
     4334  if(conduOption == 0){
     4335    poly D = getSmallest(J);    // Chooses the polynomial of smallest degree as
     4336                                // non-zerodivisor.
     4337  }
     4338  else
     4339  {
     4340    poly D = getOnevar(J, conduOption);
     4341  }
    42884342  if(dbg >= 1){
    42894343    "The non zero divisor is ", D;
     
    43114365      printlevel = printlevel + 1;
    43124366
    4313       list nor1 = normalM(Id1, decomp, withDelta)[1];
    4314       list nor2 = normalM(Id2, decomp, withDelta)[1];
     4367      list nor1 = normalM(Id1, decomp, withDelta, conduOption)[1];
     4368      list nor2 = normalM(Id2, decomp, withDelta, conduOption)[1];
    43154369      printlevel = printlevel - 1;
    43164370      return(list(nor1, nor2));
     
    43254379  J = fetch(Q, J);
    43264380  printlevel = printlevel + 1;
    4327   list result = normalMEqui(I, J, condu, D, withDelta);
     4381  list result = normalMEqui(I, J, condu, D, withDelta, conduOption);
    43284382  printlevel = printlevel - 1;
    43294383  return(list(result));
     
    45434597  }
    45444598  return(newU);
     4599}
     4600
     4601///////////////////////////////////////////////////////////////////////////////
     4602
     4603//WARNING - elim is not working here!! Check!!
     4604//It is now replace by computing an eliminating groebner basis.
     4605static proc getOnevar(ideal J, int vari)
     4606{
     4607// Computes the polynomial of smallest degree of J.
     4608// If there are more than one, it chooses the one with smallest number
     4609// of monomials.
     4610  def R = basering;
     4611  ring RR = 0, (var(3-vari), var(vari)), lp;
     4612  ideal J = imap(R, J);
     4613  J = groebner(J);
     4614  poly D = J[1];
     4615  setring R;
     4616  poly D = imap(RR, D);
     4617  return(D);
    45454618}
    45464619
Note: See TracChangeset for help on using the changeset viewer.