Changeset 3939bc in git for Singular/LIB/primdec.lib


Ignore:
Timestamp:
May 29, 1998, 5:02:06 PM (26 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
1d4300694bf8c8b67ec71e837ab58b13264fedf7
Parents:
311499b3c35b89d435a5b5b44c51e0ace5b13c6c
Message:
* hannes: changed res->nres, resu->res


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

Legend:

Unmodified
Added
Removed
  • Singular/LIB/primdec.lib

    r311499 r3939bc  
    1 // $Id: primdec.lib,v 1.20 1998-05-20 13:03:56 schmidt Exp $
     1// $Id: primdec.lib,v 1.21 1998-05-29 15:02:00 Singular Exp $
    22////////////////////////////////////////////////////////////////////////////////
    33// primdec.lib                                                                //
     
    88// algorithms for primary decomposition based on                              //
    99// the ideas of Shimoyama/Yokoyama                                            //
    10 // written by Wolfram Decker and Hans Schoenemann                             // 
     10// written by Wolfram Decker and Hans Schoenemann                             //
    1111////////////////////////////////////////////////////////////////////////////////
    1212
    13 version="$Id: primdec.lib,v 1.20 1998-05-20 13:03:56 schmidt Exp $";
     13version="$Id: primdec.lib,v 1.21 1998-05-29 15:02:00 Singular Exp $";
    1414info="
    1515LIBRARY: primdec.lib: PROCEDURE FOR PRIMARY DECOMPOSITION
     
    193193   ideal fac=tsil[2];
    194194   poly f=tsil[3];
    195    
     195
    196196   ideal star=quotient(laedi,f);
    197197   action=1;
     
    208208        g=1;
    209209        verg=laedi;
    210        
     210
    211211         for(j=1;j<=size(fac);j++)
    212212         {
     
    217217         }
    218218         verg=quotient(laedi,g);
    219          
     219
    220220         if(specialIdealsEqual(verg,star)==1)
    221221         {
     
    231231      }
    232232   }
    233    l=star,fac,f;   
     233   l=star,fac,f;
    234234   return(l);
    235235}
     
    239239{
    240240  poly keep=p;
    241  
     241
    242242   int i;
    243243   poly q=act[1][1]^act[2][1];
     
    252252      "ERROR IN FACTOR";
    253253      basering;
    254      
     254
    255255      act;
    256256      keep;
    257257      pause;
    258      
     258
    259259      p;
    260260      q;
     
    478478         m=m-1;
    479479      }
    480       //check whether i[m] =(c*var(n)+h)^e modulo prm for some 
     480      //check whether i[m] =(c*var(n)+h)^e modulo prm for some
    481481      //h in K[var(n+1),...,var(nvars(basering))], c in K
    482482      //if not (0) is returned, else var(n)+h is added to prm
     
    655655   {
    656656     attrib(l[2*i-1],"isSB",1);
    657      
     657
    658658     if((size(ser)>0)&&(size(reduce(ser,l[2*i-1],1))==0)&&(deg(l[2*i-1][1])>0))
    659659     {
    660660       "Achtung in split";
    661        
     661
    662662         l[2*i-1]=ideal(1);
    663663         l[2*i]=ideal(1);
     
    724724     return(primary);
    725725  }
    726  
    727   j=interred(j); 
     726
     727  j=interred(j);
    728728  attrib(j,"isSB",1);
    729729  if(vdim(j)==deg(j[1]))
    730   {   
     730  {
    731731     act=factor(j[1]);
    732732     for(@k=1;@k<=size(act[1]);@k++)
     
    746746       primary[2*@k]=interred(@qh);
    747747       attrib( primary[2*@k-1],"isSB",1);
    748        
     748
    749749       if((size(ser)>0)&&(size(reduce(ser,primary[2*@k-1],1))==0))
    750750       {
    751751          primary[2*@k-1]=ideal(1);
    752           primary[2*@k]=ideal(1);         
     752          primary[2*@k]=ideal(1);
    753753       }
    754754     }
     
    824824  }
    825825  else
    826   { 
     826  {
    827827     primary[1]=j;
    828828     if((size(#)>0)&&(act[2][1]>1))
     
    843843  if(size(#)==0)
    844844  {
    845    
     845
    846846     primary=splitPrimary(primary,ser,@wr,act);
    847      
     847
    848848  }
    849849
     
    868868    }
    869869  }
    870    
     870
    871871  @k=0;
    872872  ideal keep;
     
    894894                    jmap2[zz]=primary[2*@k-1][@n];
    895895                    @qht[@n]=var(zz);
    896                      
     896
    897897                }
    898898             }
     
    906906       phi1=@P,jmap1;
    907907       phi=@P,jmap;
    908  
     908
    909909       for(@n=1;@n<=nva;@n++)
    910910       {
     
    915915
    916916       @qh=phi(@qht);
    917        
     917
    918918       if(npars(@P)>0)
    919919       {
     
    943943       kill @Phelp1;
    944944       @qh=clearSB(@qh);
    945        attrib(@qh,"isSB",1);       
     945       attrib(@qh,"isSB",1);
    946946       ser1=phi1(ser);
    947947       @lh=zero_decomp (@qh,phi(ser1),@wr);
    948948//       @lh=zero_decomp (@qh,psi(ser),@wr);
    949        
    950        
     949
     950
    951951       kill lres0;
    952952       list lres0;
     
    15471547   map phi=@P,qr[2];
    15481548   i=qr[1];
    1549    
     1549
    15501550   execute "ring gnir = ("+charstr(basering)+"),("+varstr(basering)+"),("
    15511551             +ordstr(basering)+");";
     
    17881788      }
    17891789  }
    1790  
     1790
    17911791  homo=homog(i);
    1792  
     1792
    17931793  if(homo==1)
    17941794  {
     
    18371837  option(redSB);
    18381838
    1839   ideal ser=fetch(@P,ser); 
     1839  ideal ser=fetch(@P,ser);
    18401840
    18411841  if(homo==1)
     
    18911891    }
    18921892  }
    1893  
     1893
    18941894  //----------------------------------------------------------------
    18951895  //j is the ring
     
    19291929     return(primary);
    19301930  }
    1931  
     1931
    19321932 //------------------------------------------------------------------
    19331933 //the zero-dimensional case
     
    19831983      indep=maxIndependSet(@j);
    19841984   }
    1985  
     1985
    19861986  ideal jkeep=@j;
    19871987
     
    20072007      ideal jwork=std(imap(gnir,@j),@hilb);
    20082008    }
    2009    
     2009
    20102010  }
    20112011  else
     
    20182018  di=dim(jwork);
    20192019  keepdi=di;
    2020  
     2020
    20212021  setring gnir;
    20222022  for(@m=1;@m<=size(indep);@m++)
     
    20342034        attrib(@j,"isSB",1);
    20352035        ideal ser=fetch(gnir,ser);
    2036        
     2036
    20372037     }
    20382038     else
     
    20512051        }
    20522052        ideal ser=phi(ser);
    2053        
    2054      }
    2055      option(noredSB);     
     2053
     2054     }
     2055     option(noredSB);
    20562056     if((deg(@j[1])==0)||(dim(@j)<jdim))
    20572057     {
     
    21092109        }
    21102110        //the primary decomposition of j*K(var(nnp+1),..,var(nva))[..the rest..]
    2111         option(redSB);       
     2111        option(redSB);
    21122112        list uprimary= zero_decomp(@j,ser,@wr);
    21132113        option(noredSB);
     
    21712171     //mentioned above is really computed
    21722172     for(@n=@n3/2+1;@n<=@n2/2;@n++)
    2173      {       
     2173     {
    21742174        if(specialIdealsEqual(quprimary[2*@n-1],quprimary[2*@n]))
    21752175        {
     
    21862186        }
    21872187     }
    2188    
     2188
    21892189     if(size(@h)>0)
    21902190     {
     
    21962196        if(@wr!=1)
    21972197        {
    2198           @q=minSat(jwork,@h)[2];   
     2198          @q=minSat(jwork,@h)[2];
    21992199        }
    22002200        else
     
    22162216        }
    22172217        jwork=std(jwork,@q);
    2218         keepdi=dim(jwork);       
     2218        keepdi=dim(jwork);
    22192219        if(keepdi<di)
    22202220        {
     
    22412241  {
    22422242    keepdi=di-1;
    2243   } 
     2243  }
    22442244  //---------------------------------------------------------------
    22452245  //notice that j=sat(j,gh) intersected with (j,gh^n)
     
    22722272
    22732273        if(size(ser)>0)
    2274         { 
    2275            ser=intersect(htest,ser); 
     2274        {
     2275           ser=intersect(htest,ser);
    22762276        }
    22772277        else
    22782278        {
    22792279          ser=htest;
    2280         } 
     2280        }
    22812281        setring gnir;
    22822282        ser=imap(@Phelp,ser);
    22832283     }
    22842284     if(size(reduce(ser,peek,1))!=0)
    2285      {       
     2285     {
    22862286        for(@m=1;@m<=size(restindep);@m++)
    22872287        {
    22882288         // if(restindep[@m][3]>=keepdi)
    2289          // { 
     2289         // {
    22902290           isat=0;
    22912291           @n2=0;
    22922292           option(redSB);
    2293            
     2293
    22942294           if(restindep[@m][1]==varstr(basering))
    22952295           //this is the good case, nothing to do, just to have the same notations
     
    23182318           }
    23192319           option(noredSB);
    2320            
     2320
    23212321           for (lauf=1;lauf<=size(@j);lauf++)
    23222322           {
     
    23672367           }
    23682368           //the primary decomposition of j*K(var(nnp+1),..,var(nva))[..the rest..]
    2369            
     2369
    23702370           option(redSB);
    23712371           list uprimary= zero_decomp(@j,ser,@wr);
    23722372           option(noredSB);
    2373            
    2374            
     2373
     2374
    23752375           //we need the intersection of the ideals in the list quprimary with the
    23762376           //polynomialring, i.e. let q=(f1,...,fr) in the quotientring such an ideal
     
    24072407           @n2=size(quprimary);
    24082408           @n3=@n2;
    2409            
     2409
    24102410           for(@n1=1;@n1<=size(collectprimary)/2;@n1++)
    24112411           {
     
    24202420              }
    24212421           }
    2422            
    2423            
     2422
     2423
    24242424           //here the intersection with the polynomialring
    24252425           //mentioned above is really computed
     
    24602460              ser=imap(@Phelp,ser);
    24612461           }
    2462            
     2462
    24632463         // }
    2464         }             
     2464        }
    24652465        if(size(reduce(ser,peek,1))!=0)
    24662466        {
     
    24822482        }
    24832483     }
    2484      
     2484
    24852485   }
    24862486  //------------------------------------------------------------
     
    24882488  //the final result: primary
    24892489  //------------------------------------------------------------
    2490  
     2490
    24912491  setring @P;
    24922492  primary=imap(gnir,quprimary);
     
    25202520   return(phi(j));
    25212521}
    2522  
     2522
    25232523
    25242524///////////////////////////////////////////////////////////////////////////////
     
    25342534      return(ideal(0));
    25352535   }
    2536    
     2536
    25372537   def  @P = basering;
    25382538   list indep,allindep,restindep,fett,@mu;
     
    25942594
    25952595      return(ideal(@p));
    2596    }   
     2596   }
    25972597   //------------------------------------------------------------------
    25982598   //the case of a complete intersection
     
    26102610   if (jdim==0)
    26112611   {
    2612       @j1=finduni(@j); 
     2612      @j1=finduni(@j);
    26132613      for(@k=1;@k<=size(@j1);@k++)
    26142614      {
     
    26252625      return(@j);
    26262626   }
    2627  
     2627
    26282628   //------------------------------------------------------------------
    26292629   //search for a maximal independent set indep,i.e.
     
    26342634
    26352635   indep=maxIndependSet(@j);
    2636  
     2636
    26372637   di=dim(@j);
    26382638
     
    27632763      {
    27642764         fac=ideal(0);
    2765          for(lauf=1;lauf<=ncols(@h);lauf++)   
     2765         for(lauf=1;lauf<=ncols(@h);lauf++)
    27662766         {
    27672767            if(deg(@h[lauf])>0)
     
    27772777         }
    27782778
    2779        
     2779
    27802780         @mu=mstd(quotient(@j+ideal(@q),rad));
    27812781         @j=@mu[1];
    27822782         attrib(@j,"isSB",1);
    2783        
     2783
    27842784      }
    27852785      if((deg(rad[1])>0)&&(deg(collectrad[1])>0))
     
    27962796
    27972797      te=simplify(reduce(te*rad,@j),2);
    2798  
     2798
    27992799      if((dim(@j)<di)||(size(te)==0))
    28002800      {
     
    28102810   {
    28112811      return(rad);
    2812    }   
     2812   }
    28132813  // rad=intersect(rad,radicalKL(@mu,rad,@wr));
    28142814   rad=intersect(rad,radicalKL(@mu,ideal(1),@wr));
     
    28292829      il=#[1];
    28302830   }
    2831    
     2831
    28322832   option(redSB);
    28332833   list m=mstd(i);
     
    28462846        return(quotient(I,J));
    28472847      }
    2848    
     2848
    28492849      for(l=1;l<=cod;l++)
    28502850      {
     
    28642864         if(il==1)
    28652865         {
    2866      
     2866
    28672867            return(radI1);
    28682868         }
     
    28742874            return(radI1);
    28752875         }
    2876          return(intersect(radI1,radicalEHV(I2,re,il)));       
     2876         return(intersect(radI1,radicalEHV(I2,re,il)));
    28772877      }
    28782878   }
     
    29042904  }
    29052905  return(ann);
    2906 } 
    2907  
     2906}
     2907
    29082908///////////////////////////////////////////////////////////////////////////////
    29092909
     
    29152915  {
    29162916     matrix f=transpose(re[n+1]);      //Hom(_,R)
    2917      module k=res(f,2)[2];             //the kernel
     2917     module k=nres(f,2)[2];            //the kernel
    29182918     matrix g=transpose(re[n]);        //the image of Hom(_,R)
    29192919
     
    29242924     ideal ann=Ann(transpose(re[n]));
    29252925  }
    2926   return(ann);           
     2926  return(ann);
    29272927}
    29282928///////////////////////////////////////////////////////////////////////////////
     
    29372937      re=intersect1(re,quotient(a,module(b[i])));
    29382938   }
    2939    return(re);   
     2939   return(re);
    29402940}
    29412941
     
    29442944
    29452945proc analyze(list pr)
    2946 { 
     2946{
    29472947   int ii,jj;
    29482948   for(ii=1;ii<=size(pr)/2;ii++)
     
    29642964         }
    29652965      }
    2966    }   
     2966   }
    29672967}
    29682968
     
    29762976{
    29772977  def r=basering;
    2978  
     2978
    29792979  int j,k;
    29802980  map phi;
    29812981  poly p;
    2982  
     2982
    29832983  ideal iwork=i;
    29842984  ideal imap1=maxideal(1);
    29852985  ideal imap2=maxideal(1);
    2986  
     2986
    29872987
    29882988  for(j=1;j<=nvars(basering);j++)
     
    29992999        iwork[k]=var(j);
    30003000        imap1=maxideal(1);
    3001         imap2[j]=-p;       
     3001        imap2[j]=-p;
    30023002        break;
    30033003      }
     
    30073007}
    30083008
    3009        
     3009
    30103010///////////////////////////////////////////////////////
    30113011// ini_mod
     
    36053605            }
    36063606        }
    3607         dimSP=dim(SP);
     3607        dimSP=dim(SP);
    36083608        for(j=size(m);j>=1; j--)
    36093609        {
     
    38023802      {
    38033803        f=polys[k];
    3804         degf=deg(f);
     3804        degf=deg(f);
    38053805      }
    38063806    }
     
    40124012   return(0);
    40134013}
    4014        
    4015        
     4014
     4015
    40164016proc quotient2(module a,module b)
    40174017{
     
    40304030  setring @newP;
    40314031 ideal re=imap(@newr,re);
    4032  return(re);   
     4032 return(re);
    40334033}
    40344034///////////////////////////////////////////////////////////////////////////////
     
    40434043      re[i]=he;
    40444044   }
    4045    return(re);   
     4045   return(re);
    40464046}
    40474047///////////////////////////////////////////////////////////////////////////////
     
    40564056      re[2*i]=l[i][2];
    40574057   }
    4058    return(re);   
     4058   return(re);
    40594059}
    40604060
     
    40664066
    40674067proc primdecGTZ(ideal i)
    4068 "USAGE:  primdecGTZ(i); i ideal 
    4069 RETURN:  list = list of primary ideals 
     4068"USAGE:  primdecGTZ(i); i ideal
     4069RETURN:  list = list of primary ideals
    40704070                and their associated primes
    40714071NOTE:    Algorithm of Gianni, Traeger, Zacharias
     
    40874087
    40884088proc primdecSY(ideal i)
    4089 "USAGE:  primdecSY(i); i ideal 
    4090 RETURN:  list = list of primary ideals 
     4089"USAGE:  primdecSY(i); i ideal
     4090RETURN:  list = list of primary ideals
    40914091                and their associated primes
    40924092NOTE:    Algorithm of Shimoyama-Yokoyama
     
    41494149proc equiRadical(ideal i)
    41504150"USAGE:  equiRadical(i); i ideal
    4151 RETURN:  ideal = the intersection of associated primes 
     4151RETURN:  ideal = the intersection of associated primes
    41524152         of i of dimension of i
    41534153NOTE:
     
    41704170"USAGE:  radical(i); i ideal
    41714171RETURN:  ideal = the radical of i
    4172 NOTE:    a combination of the algorithms of Krick/Logar 
     4172NOTE:    a combination of the algorithms of Krick/Logar
    41734173         and Eisenbud/Huneke/Vasconcelos
    41744174EXAMPLE: example radical; shows an example
     
    41794179   if(size(#)>0)
    41804180   {
    4181      il=#[1]; 
     4181     il=#[1];
    41824182   }
    41834183   ideal re=1;
     
    41864186   map phi=@P,qr[2];
    41874187   i=qr[1];
    4188    
     4188
    41894189   list pr=facstd(i);
    41904190
     
    42234223     int odim=dim(pr[1]);
    42244224     int count=1;
    4225    
     4225
    42264226     for(j=2;j<=s;j++)
    42274227     {
     
    42814281  else
    42824282  {
    4283      list re=mres(i,0);             
    4284   } 
     4283    list re=mres(i,0);
     4284  }
    42854285  for(e=cod;e<=nvars(basering);e++)
    42864286  {
     
    42934293  }
    42944294  return(er);
    4295 } 
     4295}
    42964296example
    42974297{ "EXAMPLE:";  echo = 2;
     
    43064306proc testPrimary(list pr, ideal k)
    43074307"USAGE:   testPrimary(pr,k) pr=primdecGTZ(k) or primdecSY(k)
    4308 RETURN:   int = 1, if the intersection of the primary ideals 
     4308RETURN:   int = 1, if the intersection of the primary ideals
    43094309                in pr is k, 0 if not
    43104310NOTE:
Note: See TracChangeset for help on using the changeset viewer.