Changeset cb980ab in git


Ignore:
Timestamp:
Jul 9, 2010, 9:36:58 AM (13 years ago)
Author:
Frank Seelisch <seelisch@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
Children:
45945a262d8ca4e4d859a9967db621f41ed4c0b6
Parents:
0a4a70481cf50125462e9c1eea5eb085d8ec905a
Message:
check in on behalf of Anne: enhancements for non-global ordering

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

Legend:

Unmodified
Added
Removed
  • Singular/LIB/primdec.lib

    r0a4a704 rcb980ab  
    2121    Krick, Logar, Laplagne and Kemper (implementation by Gerhard Pfister and Santiago Laplagne).
    2222    They work in any characteristic.@*
    23     Baserings must have a global ordering and no quotient ideal.
     23    Some of the algorithms in this library require a global ordering.
     24    qrings are not possible as baserings in this library.
     25    For local or mixed orderings, most procedures handle the appropriate
     26    ring changes internally; otherwise an error message will be printed.
    2427
    2528
     
    5053LIB "triang.lib";
    5154LIB "absfact.lib";
     55LIB "ring.lib";
    5256///////////////////////////////////////////////////////////////////////////////
    5357//
     
    18881892}
    18891893///////////////////////////////////////////////////////////////////////////////
    1890 static proc cleanPrimaryS(list l)
    1891 {
    1892    int i;
    1893    list lh;
    1894    for(i=1;i<=size(l);i++)
    1895    {
    1896       l[i][2]=std(l[i][2]);
    1897       if(deg(l[i][2][1])>0)
    1898       {
    1899          lh[size(lh)+1]=l[i];
    1900       }
    1901    }
    1902    return(lh);
    1903 }
    1904 
    1905 ///////////////////////////////////////////////////////////////////////////////
    1906 static proc cleanPrimeS(list l)
    1907 {
    1908    int i;
    1909    list lh;
    1910    for(i=1;i<=size(l);i++)
    1911    {
    1912       l[i]=std(l[i]);
    1913       if(deg(l[i][1])>0)
    1914       {
    1915          lh[size(lh)+1]=l[i];
    1916       }
    1917    }
    1918    return(lh);
    1919 }
    1920 
    1921 ///////////////////////////////////////////////////////////////////////////////
    19221894
    19231895
     
    23652337"
    23662338{
     2339  if(attrib(basering,"global")!=1)
     2340  {
     2341      ERROR(
     2342      "// Not implemented for this ordering, please change to global ordering."
     2343      );
     2344  }
    23672345  intvec op ;
    23682346  def  P = basering;
    2369   if(attrib(basering,"global")!=1)
    2370   {
    2371      def PG=changeord("dp");
    2372      setring PG;
    2373      ideal i=imap(P,i);
    2374      list L=equidim(i,#);
    2375      setring P;
    2376      list L=imap(PG,L);
    2377      L=cleanPrimeS(L);
    2378      return(L);
    2379   }
    23802347  list eq;
    23812348  intvec w;
     
    24762443"
    24772444{
     2445  if(attrib(basering,"global")!=1)
     2446  {
     2447      ERROR(
     2448      "// Not implemented for this ordering, please change to global ordering."
     2449      );
     2450  }
    24782451  def  P = basering;
    2479   if(attrib(basering,"global")!=1)
    2480   {
    2481      def PG=changeord("dp");
    2482      setring PG;
    2483      ideal i=imap(P,i);
    2484      ideal L=equidimMax(i);
    2485      setring P;
    2486      ideal L=imap(PG,L);
    2487      L=std(L);
    2488      return(L);
    2489   }
    24902452  ideal eq;
    24912453  intvec w;
     
    37513713   if((reduce(f,std(h))!=0)||(reduce(diff(f,var(i)),std(h))!=0))
    37523714   {
    3753       ERROR("ERROR in GCD");
     3715      ERROR("FEHLER IN GCD");
    37543716   }
    37553717   poly g1=lift(h,f)[1][1];    //  f/h
     
    38823844"
    38833845{
     3846   if(attrib(basering,"global")!=1)
     3847   {
     3848      ERROR(
     3849      "// Not implemented for this ordering, please change to global ordering."
     3850      );
     3851   }
    38843852   if((char(basering)<100)&&(char(basering)!=0))
    38853853   {
    38863854      "WARNING: The characteristic is too small, the result may be wrong";
    38873855   }
    3888    if(attrib(basering,"global")!=1)
    3889    {
    3890      def P=basering;
    3891      def PG=changeord("dp");
    3892      setring PG;
    3893      ideal i=imap(P,i);
    3894      ideal L=radicalEHV(i);
    3895      setring P;
    3896      ideal L=imap(PG,L);
    3897      L=std(L);
    3898      return(L);
    3899    }
    3900 
    39013856   ideal J,I,I0,radI0,L,radI1,I2,radI2;
    39023857   int l,n;
     
    43994354  if((choose<0) or (choose>3))
    44004355  {
    4401     ERROR("<int> must be 0 or 1 or 2 or 3");
     4356    ERROR("ERROR: <int> must be 0 or 1 or 2 or 3");
    44024357  }
    44034358  option(notWarnSB);
     
    51495104///////////////////////////////////////////////////////////////////////////////
    51505105
    5151 proc primdecGTZ(ideal i)
     5106proc primdecGTZ(ideal i, list #)
    51525107"USAGE:   primdecGTZ(i); i ideal
    51535108RETURN:  a list pr of primary ideals and their associated primes:
     
    51565111   pr[i][2]   the i-th prime component.
    51575112@end format
    5158 NOTE:    Algorithm of Gianni/Trager/Zacharias.
    5159          Designed for characteristic 0, works also in char k > 0, if it
    5160          terminates (may result in an infinite loop in small characteristic!)
     5113NOTE:    - Algorithm of Gianni/Trager/Zacharias.
     5114         - Designed for characteristic 0, works also in char k > 0, if it
     5115           terminates (may result in an infinite loop in small characteristic!)
     5116         - For local orderings, the result is considered in the localization
     5117           of the polynomial ring, not in the power series ring
     5118         - For local and mixed orderings, the decomposition in the
     5119           corresponding global ring is returned if the string 'global'
     5120           is specified as second argument
    51615121EXAMPLE: example primdecGTZ; shows an example
    51625122"
    51635123{
     5124   if(size(#)>0)
     5125   {
     5126      int keep_comp=1;
     5127   }
    51645128   if(attrib(basering,"global")!=1)
    51655129   {
    5166      def P=basering;
    5167      def PG=changeord("dp");
    5168      setring PG;
    5169      ideal i=imap(P,i);
    5170      list L=primdecGTZ(i);
    5171      setring P;
    5172      list L=imap(PG,L);
    5173      L=cleanPrimaryS(L);
    5174      return(L);
     5130// algorithms only work in global case!
     5131// pass to appropriate global ring
     5132      def r=basering;
     5133      def s=changeord("dp");
     5134      setring s;
     5135      ideal i=imap(r,i);
     5136// decompose and go back
     5137      list li=primdecGTZ(i);
     5138      setring r;
     5139      def li=imap(s,li);
     5140// clean up
     5141      if(!defined(keep_comp))
     5142      {
     5143         for(int k=size(li);k>=1;k--)
     5144         {
     5145            if(mindeg(std(lead(li[k][2]))[1])==0)
     5146            {
     5147// 1 contained in ideal, i.e. component does not meet origin in local ordering
     5148               li=delete(li,k);
     5149            }
     5150         }
     5151      }
     5152      return(li);
    51755153   }
     5154
    51765155   if(minpoly!=0)
    51775156   {
    51785157      return(algeDeco(i,0));
    51795158      ERROR(
    5180       "Not implemented yet for algebraic extensions.Simulate the ring extension by adding the minpoly to the ideal"
     5159      "// Not implemented yet for algebraic extensions.Simulate the ring extension by adding the minpoly to the ideal"
    51815160      );
    51825161   }
     
    51935172}
    51945173///////////////////////////////////////////////////////////////////////////////
    5195 proc absPrimdecGTZ(ideal I)
     5174proc absPrimdecGTZ(ideal I, list #)
    51965175"USAGE:   absPrimdecGTZ(I); I ideal
    51975176ASSUME:  Ground field has characteristic 0.
    5198 RETURN:  a ring containing two lists: @code{absolute_primes} (the absolute
    5199          prime components of I) and @code{primary_decomp} (the output of
    5200          @code{primdecGTZ(I)}).
     5177RETURN:  a ring containing two lists: @code{absolute_primes}, the absolute
     5178         prime components of I, and @code{primary_decomp}, the output of
     5179         @code{primdecGTZ(I)}.
    52015180         The list absolute_primes has to be interpreted as follows:
    52025181         each entry describes a class of conjugated absolute primes,
     
    52085187         polynomial of a minimal finite field extension over which the
    52095188         absolute prime component is defined.
     5189         For local orderings, the result is considered in the localization
     5190         of the polynomial ring, not in the power series ring.
     5191         For local and mixed orderings, the decomposition in the
     5192         corresponding global ring is returned if the string 'global'
     5193         is specified as second argument
    52105194NOTE:    Algorithm of Gianni/Trager/Zacharias combined with the
    52115195         @code{absFactorize} command.
     
    52205204  }
    52215205
     5206  if(size(#)>0)
     5207  {
     5208     int keep_comp=1;
     5209  }
     5210
    52225211  if(attrib(basering,"global")!=1)
    52235212  {
    5224     ERROR(
    5225       "Not implemented for this ordering, please change to global ordering."
    5226     );
     5213// algorithm automatically passes to the global case
     5214// hence prepare to go back to an appropriate new ring
     5215      def r=basering;
     5216      ideal max_of_r=maxideal(1);
     5217      def s=changeord("dp");
     5218      setring s;
     5219      def I=imap(r,I);
     5220      def S=absPrimdecGTZ(I);
     5221      setring S;
     5222      ring r1=char(basering),var(nvars(r)+1),dp;
     5223      def rS=r+r1;
     5224// move objects to appropriate ring and clean up
     5225      setring rS;
     5226      def max_of_r=imap(r,max_of_r);
     5227      attrib(max_of_r,"isSB",1);
     5228      def absolute_primes=imap(S,absolute_primes);
     5229      def primary_decomp=imap(S,primary_decomp);
     5230      if(!defined(keep_comp))
     5231      {
     5232         ideal tempid;
     5233         for(int k=size(absolute_primes);k>=1;k--)
     5234         {
     5235            tempid=absolute_primes[k][1];
     5236            tempid[1]=0;                  // ignore minimal polynomial
     5237            if(size(reduce(lead(tempid),max_of_r))!=0)
     5238            {
     5239// 1 contained in ideal, i.e. component does not meet origin in local ordering
     5240               absolute_primes=delete(absolute_primes,k);
     5241            }
     5242         }     
     5243         for(k=size(primary_decomp);k>=1;k--)
     5244         {
     5245            if(mindeg(std(lead(primary_decomp[k][2]))[1])==0)
     5246            {
     5247// 1 contained in ideal, i.e. component does not meet origin in local ordering
     5248               primary_decomp=delete(primary_decomp,k);
     5249            }
     5250         }
     5251         kill tempid;
     5252      }
     5253      export(primary_decomp);
     5254      export(absolute_primes);
     5255      return(rS);
    52275256  }
    52285257  if(minpoly!=0)
     
    52305259    //return(algeDeco(i,0));
    52315260    ERROR(
    5232       "Not implemented yet for algebraic extensions.Simulate the ring extension by adding the minpoly to the ideal"
     5261      "// Not implemented yet for algebraic extensions.Simulate the ring extension by adding the minpoly to the ideal"
    52335262    );
    52345263  }
     
    52895318    primary_decomp[i]=list(L[i][1],L[i][2]);
    52905319  }
    5291   for(ii=1;ii<=size(absolute_primes);ii++)
    5292   {
    5293      absolute_primes[ii][1]=interred(absolute_primes[ii][1]);
    5294   }
    52955320  export(primary_decomp);
    52965321  export(absolute_primes);
    52975322  setring R;
    5298 dbprint( printlevel-voice+3,"
    5299 // def S = absPrimdecGTZ(i); creates a ring,
    5300 // which comes with two lists:
    5301 // absolute_primes -- the absolute prime components,
    5302 // and primary_decomp -- the primary and prime
    5303 // components over the current basering).
    5304 // Type setring S; absolute_primes;
    5305 // to access the data.
    5306 ");
     5323  dbprint( printlevel-voice+3,"
     5324// 'absPrimdecGTZ' created a ring, in which two lists absolute_primes (the
     5325// absolute prime components) and primary_decomp (the primary and prime
     5326// components over the current basering) are stored.
     5327// To access the list of absolute prime components, type (if the name S was
     5328// assigned to the return value):
     5329        setring S; absolute_primes; ");
     5330
    53075331  return(Rz);
    53085332}
     
    53345358   if c=3,  minAssGTZ and facstd are used.
    53355359@end format
     5360         For local orderings, the result is considered in the localization
     5361         of the polynomial ring, not in the power series ring.
     5362         For local and mixed orderings, the decomposition in the
     5363         corresponding global ring is returned if the string 'global'
     5364         is specified as third argument
    53365365EXAMPLE: example primdecSY; shows an example
    53375366"
    53385367{
     5368   if(size(#)>1)
     5369   {
     5370      int keep_comp=1;
     5371   }
    53395372   if(attrib(basering,"global")!=1)
    53405373   {
    5341      def P=basering;
    5342      def PG=changeord("dp");
    5343      setring PG;
    5344      ideal i=imap(P,i);
    5345      list L=primdecSY(i,#);
    5346      setring P;
    5347      list L=imap(PG,L);
    5348      L=cleanPrimaryS(L);
    5349      return(L);
     5374// algorithms only work in global case!
     5375// pass to appropriate global ring
     5376      def r=basering;
     5377      def s=changeord("dp");
     5378      setring s;
     5379      ideal i=imap(r,i);
     5380// decompose and go back
     5381      list li=primdecSY(i);
     5382      setring r;
     5383      def li=imap(s,li);
     5384// clean up
     5385      if(!defined(keep_comp))
     5386      {
     5387         for(int k=size(li);k>=1;k--)
     5388         {
     5389            if(mindeg(std(lead(li[k][2]))[1])==0)
     5390            {
     5391// 1 contained in ideal, i.e. component does not meet origin in local ordering
     5392               li=delete(li,k);
     5393            }
     5394         }
     5395      }
     5396      return(li);
    53505397   }
    5351 
    53525398   i=simplify(i,2);
    53535399   if ((i[1]==0)||(i[1]==1))
     
    53565402     return(list(L));
    53575403   }
     5404
    53585405   if(minpoly!=0)
    53595406   {
    53605407      return(algeDeco(i,1));
    53615408   }
    5362    if (size(#)==1)
     5409   if (size(#)!=0)
    53635410   { return(prim_dec(i,#[1])); }
    53645411   else
     
    53845431
    53855432RETURN:  a list, the minimal associated prime ideals of I.
    5386 NOTE:    Designed for characteristic 0, works also in char k > 0 based
    5387          on an algorithm of Yokoyama
     5433NOTE:    - Designed for characteristic 0, works also in char k > 0 based
     5434           on an algorithm of Yokoyama
     5435         - For local orderings, the result is considered in the localization
     5436           of the polynomial ring, not in the power series ring
     5437         - For local and mixed orderings, the decomposition in the
     5438           corresponding global ring is returned if the string 'global'
     5439           is specified as second argument
    53885440EXAMPLE: example minAssGTZ; shows an example
    53895441"
    53905442{
     5443   if(size(#)>0)
     5444   {
     5445      int keep_comp=1;
     5446   }
     5447
     5448  if(attrib(basering,"global")!=1)
     5449  {
     5450  // algorithms only work in global case!
     5451// pass to appropriate global ring
     5452      def r=basering;
     5453      def s=changeord("dp");
     5454      setring s;
     5455      ideal i=imap(r,i);
     5456// decompose and go back
     5457      list li=minAssGTZ(i);
     5458      setring r;
     5459      def li=imap(s,li);
     5460// clean up
     5461      if(!defined(keep_comp))
     5462      {
     5463         for(int k=size(li);k>=1;k--)
     5464         {
     5465            if(mindeg(std(lead(li[k]))[1])==0)
     5466            {
     5467// 1 contained in ideal, i.e. component does not meet origin in local ordering
     5468               li=delete(li,k);
     5469            }
     5470         }
     5471      }
     5472      return(li);
     5473  }
     5474
    53915475  int j;
    53925476  string algorithm;
     
    54265510      }
    54275511    }
    5428   }
    5429   if(attrib(basering,"global")!=1)
    5430   {
    5431      def P=basering;
    5432      def PG=changeord("dp");
    5433      setring PG;
    5434      ideal i=imap(P,i);
    5435      list L=minAssGTZ(i,#);
    5436      setring P;
    5437      list L=imap(PG,L);
    5438      L=cleanPrimeS(L);
    5439      return(L);
    54405512  }
    54415513
     
    54655537         Otherwise, the system tries to find an optimal ordering,
    54665538         which in some cases may considerably speed up the algorithm. @*
     5539         For local orderings, the result is considered in the localization
     5540         of the polynomial ring, not in the power series ring
     5541         For local and mixed orderings, the decomposition in the
     5542         corresponding global ring is returned if the string 'global'
     5543         is specified as third argument
    54675544EXAMPLE: example minAssChar; shows an example
    54685545"
    54695546{
     5547   if(size(#)>1)
     5548   {
     5549      int keep_comp=1;
     5550   }
    54705551   if(attrib(basering,"global")!=1)
    54715552   {
    5472      def P=basering;
    5473      def PG=changeord("dp");
    5474      setring PG;
    5475      ideal i=imap(P,i);
    5476      list L=minAssChar(i,#);
    5477      setring P;
    5478      list L=imap(PG,L);
    5479      L=cleanPrimeS(L);
    5480      return(L);
     5553// algorithms only work in global case!
     5554// pass to appropriate global ring
     5555      def r=basering;
     5556      def s=changeord("dp");
     5557      setring s;
     5558      ideal i=imap(r,i);
     5559// decompose and go back
     5560      list li=minAssChar(i);
     5561      setring r;
     5562      def li=imap(s,li);
     5563// clean up
     5564      if(!defined(keep_comp))
     5565      {
     5566         for(int k=size(li);k>=1;k--)
     5567         {
     5568            if(mindeg(std(lead(li[k]))[1])==0)
     5569            {
     5570// 1 contained in ideal, i.e. component does not meet origin in local ordering
     5571               li=delete(li,k);
     5572            }
     5573         }
     5574      }
     5575      return(li);
    54815576   }
    5482 
    5483    if (size(#)==1)
     5577   if (size(#)>0)
    54845578   { return(min_ass_prim_charsets(i,#[1])); }
    54855579   else
     
    55045598"
    55055599{
    5506    if(attrib(basering,"global")!=1)
    5507    {
    5508      def P=basering;
    5509      def PG=changeord("dp");
    5510      setring PG;
    5511      ideal i=imap(P,i);
    5512      ideal L=equiRadical(i);
    5513      setring P;
    5514      ideal L=imap(PG,L);
    5515      L=std(L);
    5516      return(L);
    5517    }
    5518 
     5600  if(attrib(basering,"global")!=1)
     5601  {
     5602     ERROR(
     5603     "// Not implemented for this ordering, please change to global ordering."
     5604     );
     5605  }
    55195606  return(radical(i, 1));
    55205607}
     
    55455632"
    55465633{
    5547    dbprint(printlevel - voice, "Radical, version 2006.05.08");
    5548    if(attrib(basering,"global")!=1)
    5549    {
    5550      def P=basering;
    5551      def PG=changeord("dp");
    5552      setring PG;
    5553      ideal i=imap(P,i);
    5554      ideal L=radical(i,#);
    5555      setring P;
    5556      ideal L=imap(PG,L);
    5557      L=std(L);
    5558      return(L);
    5559    }
    5560 
     5634  dbprint(printlevel - voice, "Radical, version 2006.05.08");
     5635  if(attrib(basering,"global")!=1)
     5636  {
     5637// algorithms only work in global case!
     5638// pass to appropriate global ring
     5639      def r=basering;
     5640      def s=changeord("dp");
     5641      setring s;
     5642      ideal i=imap(r,i);
     5643// compute radical and go back
     5644      def j=radical(i);
     5645      setring r;
     5646      def j=imap(s,j);
     5647      return(j);
     5648  }
    55615649  if(size(i) == 0){return(ideal(0));}
    55625650  int j;
     
    63256413  if(attrib(basering,"global")!=1)
    63266414  {
    6327      def P=basering;
    6328      def PG=changeord("dp");
    6329      setring PG;
    6330      ideal i=imap(P,i);
    6331      list L=prepareAss(i);
    6332      setring P;
    6333      list L=imap(PG,L);
    6334      L=cleanPrimeS(L);
    6335      return(L);
    6336   }
    6337 
     6415      ERROR(
     6416      "// Not implemented for this ordering, please change to global ordering."
     6417      );
     6418  }
    63386419  ideal j=std(i);
    63396420  int cod=nvars(basering)-dim(j);
     
    63786459"
    63796460{
    6380    if(attrib(basering,"global")!=1)
    6381    {
    6382      def P=basering;
    6383      def PG=changeord("dp");
    6384      setring PG;
    6385      ideal i=imap(P,i);
    6386      ideal L=equidimMaxEHV(i);
    6387      setring P;
    6388      ideal L=imap(PG,L);
    6389      L=std(L);
    6390      return(L);
    6391    }
    6392 
     6461  if(attrib(basering,"global")!=1)
     6462  {
     6463      ERROR(
     6464      "// Not implemented for this ordering, please change to global ordering."
     6465      );
     6466  }
    63936467  ideal j=groebner(i);
    63946468  int cod=nvars(basering)-dim(j);
     
    64536527"
    64546528{
     6529  if(attrib(basering,"global")!=1)
     6530  {
     6531    ERROR(
     6532    "// Not implemented for this ordering, please change to global ordering."
     6533    );
     6534  }
    64556535  def R=basering;
    6456   if(attrib(basering,"global")!=1)
    6457   {
    6458      def PG=changeord("dp");
    6459      setring PG;
    6460      ideal i=imap(R,I);
    6461      list L=zerodec(i);
    6462      setring R;
    6463      list L=imap(PG,L);
    6464      L=cleanPrimeS(L);
    6465      return(L);
    6466   }
    6467 
    64686536  poly q;
    64696537  int j,time;
Note: See TracChangeset for help on using the changeset viewer.