Changeset 651cce in git for Singular/LIB/normal.lib


Ignore:
Timestamp:
Nov 4, 2010, 4:38:05 PM (13 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
575e1d69abebbd00c1bdff81f7e716b23b3f5df7
Parents:
018ee93eacab982f9eb9248a037a688cebe35065
Message:
fix hadling of options

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

Legend:

Unmodified
Added
Removed
  • Singular/LIB/normal.lib

    r018ee9 r651cce  
    25782578"
    25792579{
     2580   intvec save_opt=option(get);
    25802581   option(redSB);
    25812582   def R=basering;
     
    26712672   {
    26722673      setring R;
     2674      option(set,save_opt);
    26732675      return(list(0,0,1));
    26742676   }
     
    26802682         setring R;
    26812683         delt=(tau+1)/2;
     2684         option(set,save_opt);
    26822685         return(list(d*delt,d*tau,d*(2*delt-tau+1)));
    26832686      }
     
    26882691         setring R;
    26892692         delt=(tau+2)/2;
     2693         option(set,save_opt);
    26902694         return(list(d*delt,d*tau,d*(2*delt-tau+1)));
    26912695      }
     
    27062710        }
    27072711        if(w>=1){"Newton-Polygon is non-degenerated";"";}
     2712        option(set,save_opt);
    27082713        return(list(d*(mu+nb-1)/2,d*tau,d*nb));
    27092714      }
     
    27382743         nb=deltaLoc(f1,maxideal(1))[3]+deltaLoc(f2,maxideal(1))[3];
    27392744         setring R;
     2745         option(set,save_opt);
    27402746         return(list(d*(mu+nb-1)/2,d*tau,d*nb));
    27412747      }
     
    27522758         }
    27532759         setring R;
     2760         option(set,save_opt);
    27542761         return(list(d*(mu+nb-1)/2,d*tau,d*nb));
    27552762      }
     
    27662773        nb=size(HNEXP);
    27672774      }
     2775      option(set,save_opt);
    27682776      return(list(d*(mu+nb-1)/2,d*tau,d*nb));
    27692777   }
     
    27732781      if(w>=1){"now we have to use Hamburger-Noether (Puiseux) expansion";}
    27742782      delt=delta(f);
     2783      option(set,save_opt);
    27752784      return(list(d*delt,d*tau,d));
    27762785   }
     2786   option(set,save_opt);
    27772787}
    27782788example
     
    42504260// denomOption = i > 0  -> Uses a polynomial in the i-th variable
    42514261
    4252   option("redSB");
    4253   option("returnSB");
     4262  intvec save_opt=option(get);
     4263  option(redSB);
     4264  option(returnSB);
    42544265  int step = 0;                       // Number of steps. (for debugging)
    42554266  int dbg = printlevel - voice + 2;   // dbg = printlevel (default: dbg = 0)
     
    42624273
    42634274//------------------------ Groebner bases and dimension of I-----------------
    4264   if(isGlobal == 1){
     4275  if(isGlobal == 1)
     4276  {
    42654277    list IM = mstd(I);
    42664278    I = IM[1];
     
    42804292  // This is done only in the first step.
    42814293  qring Q = I;   // We work in the quotient by the groebner base of the ideal I
    4282   option("redSB");
    4283   option("returnSB");
     4294  option(redSB);
     4295  option(returnSB);
    42844296
    42854297  // If a conductor ideal was given as input, we use it instead of the
     
    42884300  ideal inputC = fetch(R, inputC);
    42894301  ideal inputJ = fetch(R, inputJ);
    4290   if((inputC == 0) && (inputJ == 0)){
     4302  if((inputC == 0) && (inputJ == 0))
     4303  {
    42914304    // We compute the radical of the ideal of minors modulo the original ideal.
    42924305    // This is done only in the first step.
     
    43014314    ideal J = minor(jacob(IMin), nvars(basering) - d, I);
    43024315    J = groebner(J);
    4303   } else {
     4316  }
     4317  else
     4318  {
    43044319    ideal J = fetch(R, inputC);
    43054320    J = groebner(J);
     
    43074322
    43084323  //------------------ We check if the singular locus is empty -------------
    4309   if(J[1] == 1){
     4324  if(J[1] == 1)
     4325  {
    43104326    // The original ring R/I was normal. Nothing to do.
    43114327    // We define anyway a new ring, equal to R, to be able to return it.
     
    43194335    export normap;
    43204336    setring R;
    4321     if(withDelta){
     4337    if(withDelta)
     4338    {
    43224339      list output = ideal(1), poly(1), ROut, 0;
    43234340    }
     
    43264343      list output = ideal(1), poly(1), ROut;
    43274344    }
     4345    option(set,save_opt);
    43284346    return(list(output));
    43294347  }
     
    43344352  // compute a universal denominator.
    43354353  ideal Id1;
    4336   if(J != 0){
    4337     if(denomOption == 0){
     4354  if(J != 0)
     4355  {
     4356    if(denomOption == 0)
     4357    {
    43384358      poly condu = getSmallest(J);   // Choses the polynomial of smallest degree
    43394359                                     // of J as universal denominator.
    4340     } else {
     4360    }
     4361    else
     4362    {
    43414363      poly condu = getOneVar(J, denomOption);
    43424364    }
    4343     if(dbg >= 1){
     4365    if(dbg >= 1)
     4366    {
    43444367      "";
    43454368      "The universal denominator is ", condu;
     
    43504373    // the universal denominator is a non-zerodivisor of R/I.
    43514374    // If not, we split I.
    4352     if((decomp == 1) or (decomp == 2)){
     4375    if((decomp == 1) or (decomp == 2))
     4376    {
    43534377      Id1 = quotient(0, condu);
    4354       if(size(Id1) > 0){
     4378      if(size(Id1) > 0)
     4379      {
    43554380        // We have to split.
    4356         if(dbg >= 1){
     4381        if(dbg >= 1)
     4382        {
    43574383          "A zerodivisor was found. We split the ideal. The zerodivisor is ", condu;
    43584384        }
     
    43674393        list nor2 = normalM(Id2, decomp, withDelta, denomOption, JDefault, JDefault)[1];
    43684394        printlevel = printlevel - 1;
     4395        option(set,save_opt);
    43694396        return(list(nor1, nor2));
    43704397      }
    43714398    }
    4372   } else {
     4399  }
     4400  else
     4401  {
    43734402    poly condu = 0;
    43744403  }
     
    43804409  setring R;
    43814410  // If a test ideal is given at the input, we use it.
    4382   if(inputJ == 0){
    4383     if(isGlobal == 1){
     4411  if(inputJ == 0)
     4412  {
     4413    if(isGlobal == 1)
     4414    {
    43844415      ideal J = fetch(Q, J);
    43854416      J = J, I;
    4386       if(dbg >= 1){
     4417      if(dbg >= 1)
     4418      {
    43874419        "The original singular locus is";
    43884420        groebner(J);
     
    43934425      // If so, the radical is the maximal ideal at the origin.
    43944426      J = groebner(J);
    4395       if(locAtZero(J)){
     4427      if(locAtZero(J))
     4428      {
    43964429        J = maxideal(1);
    4397       } else {
     4430      }
     4431      else
     4432      {
    43984433        J = radical(J);
    43994434      }
    4400     } else {
     4435    }
     4436    else
     4437    {
    44014438      // We change to global dp ordering.
    44024439      list rl = ringlist(R);
     
    44094446      ideal I = fetch(R, I);
    44104447      J = J, I;
    4411       if(dbg >= 1){
     4448      if(dbg >= 1)
     4449      {
    44124450        "The original singular locus is";
    44134451        groebner(J);
     
    44194457      ideal J = fetch(globR, J);
    44204458    }
    4421   } else {
     4459  }
     4460  else
     4461  {
    44224462    ideal J = inputJ;
    44234463  }
    44244464
    4425   if(dbg >= 1){
     4465  if(dbg >= 1)
     4466  {
    44264467    "The radical of the original singular locus is";
    44274468    J;
     
    44334474  J = fetch(R, J);
    44344475  J = interred(J);
    4435   if(denomOption == 0){
     4476  if(denomOption == 0)
     4477  {
    44364478    poly D = getSmallest(J);    // Chooses the polynomial of smallest degree as
    44374479                                // non-zerodivisor.
    4438   } else {
     4480  }
     4481  else
     4482  {
    44394483    poly D = getOneVar(J, denomOption);
    44404484  }
    4441   if(dbg >= 1){
     4485  if(dbg >= 1)
     4486  {
    44424487    "The non zero divisor is ", D;
    44434488    "";
     
    44484493  // is actually a non-zerodivisor of R/I.
    44494494  // If not, we split I.
    4450   if((decomp == 1) or (decomp == 2)){
     4495  if((decomp == 1) or (decomp == 2))
     4496  {
    44514497    // We check if D is actually a non-zerodivisor of R/I.
    44524498    // If not, we split I.
    44534499    Id1 = quotient(0, D);
    4454     if(size(Id1) > 0){
     4500    if(size(Id1) > 0)
     4501    {
    44554502      // We have to split.
    4456       if(dbg >= 1){
     4503      if(dbg >= 1)
     4504      {
    44574505        "A zerodivisor was found. We split the ideal. The zerodivisor is ", D;
    44584506      }
     
    44684516      list nor2 = normalM(Id2, decomp, withDelta, denomOption, JDefault, JDefault)[1];
    44694517      printlevel = printlevel - 1;
     4518      option(set,save_opt);
    44704519      return(list(nor1, nor2));
    44714520    }
     
    44814530  list result = normalMEqui(I, J, condu, D, withDelta, denomOption);
    44824531  printlevel = printlevel - 1;
     4532  option(set,save_opt);
    44834533  return(list(result));
    44844534}
     
    45114561
    45124562  qring Q = groebner(I);
    4513   option("redSB");
    4514   option("returnSB");
     4563  intvec save_opt=option(get);
     4564  option(redSB);
     4565  option(returnSB);
    45154566  ideal J = imap(R, origJ);
    45164567  poly c = imap(R, c);
     
    45614612      list output = ideal(1), poly(1), ROut;
    45624613    }
     4614    option(set,save_opt);
    45634615    return(output);
    45644616  }
     
    46214673      // If we have a universal denominator of smaller degree than c,
    46224674      // we replace c by it.
    4623       if(condu != 0){
     4675      if(condu != 0)
     4676      {
    46244677        if(deg(c) > deg(condu))
    46254678        {
     
    46604713    list output = U, c, ere;
    46614714  }
     4715  option(set,save_opt);
    46624716  return(output);
    46634717}
     
    48894943
    48904944  // ----- computation of the test ideal using the ring structure of Ai -----
    4891   option("redSB");
    4892   option("returnSB");
     4945  intvec save_opt=option(get);
     4946  option(redSB);
     4947  option(returnSB);
    48934948
    48944949  if(dbg > 1){"Computing the radical of J...";}
     
    49965051  J = imap(Q, J);
    49975052
     5053  option(set,save_opt);
    49985054  return(list(J, ele[1]));
    49995055}
Note: See TracChangeset for help on using the changeset viewer.