Changeset f9ca02 in git for Singular/LIB/primdecint.lib


Ignore:
Timestamp:
Sep 27, 2010, 12:21:25 PM (14 years ago)
Author:
Stefan Steidel <steidel@…>
Branches:
(u'spielwiese', '4a9821a93ffdc22a6696668bd4f6b8c9de3e6c5f')
Children:
59a7ca1a2295e730269784972ec5b06a44bed680
Parents:
d8423632ac2a14a2b19b324e619be2d5757af760
Message:
Documentation

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

Legend:

Unmodified
Added
Removed
  • Singular/LIB/primdecint.lib

    rd84236 rf9ca02  
    99@*        S. Steidel      steidel@mathematik.uni-kl.de
    1010
    11 NOTE:
     11OVERVIEW:
    1212
    1313  A library for computing the primary decomposition of an ideal in the polynomial
     
    2525
    2626////////////////////////////////////////////////////////////////////////////////
    27 
    2827
    2928proc primdecZ(ideal I, list #)
     
    4241   if(size(I)==0){return(list(ideal(0),ideal(0)));}
    4342
    44 
    4543   //--------------------  Initialize optional parameters  ------------------------
    4644   if(size(#) > 0)
     
    109107      //=== computes the primes occuring in a generator of I intersect Z
    110108
    111 
    112 
    113109      list L = primefactors(q);
    114110
    115 
    116 
    117111      list A;
    118 
    119112      ideal J = imap(R,J);
    120113
    121 
    122 
    123114      for(j=1;j<=size(L[3]);j++)
    124115      {
    125116         if(L[3][j] > 1){ ex = 1; break; }
    126 
    127117      }
    128118
     
    164154            for(i = 1; i <= n; i++)
    165155            {
    166                if(status(l(i), "read", "ready"))                         // ask if link l(i) is ready otherwise sleep for t seconds
     156               //=== ask if link l(i) is ready otherwise sleep for t seconds
     157               if(status(l(i), "read", "ready"))                         
    167158               {
    168                   A[size(A)+1] = read(l(i));                             // read the result from l(i)
     159                  //=== read the result from l(i)
     160                  A[size(A)+1] = read(l(i));                             
    169161
    170162                  if(j <= size(L[3]))
     
    182174               }
    183175            }
    184             if(k_link == n)                                              // k_link describes the number of closed links
     176            //=== k_link describes the number of closed links
     177            if(k_link == n)                                             
    185178            {
    186179               j++;
     
    197190         }
    198191      }
    199 
    200192
    201193      setring R;
     
    368360         pr[size(pr)+1]=M[i];
    369361      }
    370 
    371362   }
    372363   return(pr);
     
    900891
    901892static proc modp(ideal J, int p, int nu)
    902 
    903 {
    904 
     893{
     894//=== computes the minimal associated primes (if nu > 1) resp. the primary
     895//=== decomposition (else) of J in Z/p and maps the result back to the basering
    905896   def R = basering;
    906 
    907897   list rp = ringlist(R);
    908898   rp[1] = p;
     
    915905      list A = minAssGTZ(J);
    916906      setring R;
    917 
    918907      list A = imap(Rp,A);
    919 
    920908      return(list(A,p,nu));
    921 
    922    }
    923 
     909   }
    924910   else
    925 
    926    {
    927 
     911   {
    928912      list A = primdecGTZ(J);
    929 
    930913      setring R;
    931 
    932914      list A = imap(Rp,A);
    933 
    934915      return(list(A,p,nu));
    935 
    936    }
    937 
    938 }
    939 
     916   }
     917}
    940918
    941919////////////////////////////////////////////////////////////////////////////////
     
    943921static proc coefPrimeZ(ideal I)
    944922{
    945 //=== computes the primes occurning in the product of the leading coefficients of I
     923//=== computes the primes occuring in the product of the leading coefficients of I
    946924   number h=1;
    947925   int i;
     
    963941static proc coefZ(ideal I)
    964942{
    965    //assume === IQ[variables]=<g_1,...,g_s>, Groebner basis, g_i in Z[variables]
    966    //=== computes an integer h such that
    967    //=== <g_1,...,g_s>Z[variables]:h^infinity = IQ[variables] intersected with Z[variables]
    968    //=== returns a list with IQ[variables] intersected with Z[variables] and h
     943//=== assume IQ[variables]=<g_1,...,g_s>, Groebner basis, g_i in Z[variables]
     944//=== computes an integer h such that
     945//=== <g_1,...,g_s>Z[variables]:h^infinity = IQ[variables] intersected with Z[variables]
     946//=== returns a list with IQ[variables] intersected with Z[variables] and h
    969947   int h=1;
    970948   int i,e;
     
    10981076         rl[1]=0;
    10991077         def Shelp =ring(rl);
    1100 
    11011078      }
    11021079      poly h=1;
     
    11501127   while(size(reduce(J,stdZ(I)))!=0)
    11511128   {
    1152        I=J;
    1153        J=quotientOneZ(I,h);
    1154        J=normalizeZ(J);
     1129      I=J;
     1130      J=quotientOneZ(I,h);
     1131      J=normalizeZ(J);
    11551132   }
    11561133   return(J);
     
    11611138static proc prepareQuotientring (int nnp)
    11621139{
    1163 //=== this is from primdec.lib, it is static there, should be imported later if it is no more static
     1140//=== this is from primdec.lib, it is static there, should be imported later
     1141//=== if it is no more static
    11641142  ideal @ih,@jh;
    11651143  int npar=npars(basering);
     
    11771155  for(@n=2;@n<=nnp;@n++)
    11781156  {
    1179     quotring=quotring+",var("+string(@n)+")";
    1180     @jh=@jh+var(@n);
     1157     quotring=quotring+",var("+string(@n)+")";
     1158     @jh=@jh+var(@n);
    11811159  }
    11821160  quotring=quotring+"),(C,lp);";
    11831161
    11841162  return(quotring);
    1185 
    11861163}
    11871164
     
    11901167static proc maxIndependSet (ideal j)
    11911168{
    1192 
    1193 //=== this is from primdec.lib, it is static there, should be imported later if it is no more static
     1169//=== this is from primdec.lib, it is static there, should be imported later
     1170//=== if it is no more static
    11941171  int n,k,di;
    11951172
     
    12431220static proc quotientOneZ(ideal I, poly f)
    12441221{
    1245 //=== this is needed because quotient(I,f) does not work properly, should be replaced by quotient later
     1222//=== this is needed because quotient(I,f) does not work properly, should be
     1223//=== replaced by quotient later
    12461224   def R=basering;
    12471225   int i;
    12481226   ideal K=intersectZ(I,ideal(f));
    1249    //=== K[i]/f; does not work in rings with integer! This should by replaced later
     1227   //=== K[i]/f; does not work in rings with integer! This should be replaced later
    12501228   execute("ring Rhelp=0,("+varstr(R)+"),dp;");
    12511229   ideal K=imap(R,K);
     
    12641242static proc quotientZ(ideal I, ideal J)
    12651243{
    1266 //=== this is needed because quotient(I,J) does not work properly, should be replaced by quotient later
     1244//=== this is needed because quotient(I,J) does not work properly, should be
     1245//=== replaced by quotient later
    12671246   int i;
    12681247   ideal K=quotientOneZ(I,J[1]);
     
    12781257static proc reduceZ(poly f, ideal I)
    12791258{
    1280 //=== this is needed because reduce(f,I) does not work properly, should be replaced by reduce later
     1259//=== this is needed because reduce(f,I) does not work properly, should be
     1260//=== replaced by reduce later
    12811261   if(f==0){return(f);}
    12821262   def R=basering;
     
    12971277         if(m!=0)
    12981278         {
    1299              n=leadcoef(f) mod leadcoef(I[j]);
    1300              if(n==0)
    1301              {
    1302                  f=f-leadcoef(f)/leadcoef(I[j])*m*I[j];
    1303                  if(f==0){setring R;return(0);}
    1304                  i=0;
    1305                  break;
    1306               }
    1307               if(n!=leadcoef(f))
    1308               {
    1309                    f=f+(n-leadcoef(f))/leadcoef(I[j])*m*I[j];
    1310                    i=0;
    1311                    break;
    1312                }
    1313 
    1314           }
     1279            n=leadcoef(f) mod leadcoef(I[j]);
     1280            if(n==0)
     1281            {
     1282               f=f-leadcoef(f)/leadcoef(I[j])*m*I[j];
     1283               if(f==0){setring R;return(0);}
     1284               i=0;
     1285               break;
     1286            }
     1287            if(n!=leadcoef(f))
     1288            {
     1289               f=f+(n-leadcoef(f))/leadcoef(I[j])*m*I[j];
     1290               i=0;
     1291               break;
     1292            }
     1293         }
    13151294      }
    13161295   }
     
    13251304{
    13261305//=== this is needed because we want the leading coefficients to be positive
    1327 //=== otherwhise reduce gives wrong results!   should be replaced later by std
     1306//=== otherwhise reduce gives wrong results! should be replaced later by std
    13281307   I=simplify(I,2);
    13291308   I=normalizeZ(I);
     
    13411320///////////////////////////////////////////////////////////////////////////////
    13421321
    1343 proc intersectZ(ideal I, ideal J)
    1344 {
    1345 //=== this is needed because intersect(I,J) does not work, should be replaced by intersect later
     1322static proc intersectZ(ideal I, ideal J)
     1323{
     1324//=== this is needed because intersect(I,J) does not work, should be replaced
     1325//=== by intersect later
    13461326   def R = basering;
    13471327   execute("ring S=integer,(t,"+varstr(R)+"),(dp(1),dp(nvars(R)));");
     
    13931373
    13941374/*
    1395 examples
     1375Examples:
    13961376
    13971377//=== IQ[a,b,c,d,e,f,g] intersect Z[a,b,c,d,e,f,g] = I  (takes some time)
Note: See TracChangeset for help on using the changeset viewer.