Ignore:
Timestamp:
Sep 24, 2010, 4:52:16 PM (14 years ago)
Author:
Stefan Steidel <steidel@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
f0e080284bc1a4ba286ba66df791c785e808feb8
Parents:
1492bbce4e131a22de468dd41b9ced71d0fe3f93
Message:
new libs

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

Legend:

Unmodified
Added
Removed
  • Singular/LIB/assprimeszerodim.lib

    • Property mode changed from 100644 to 100755
    r1492bb r2e7410  
    11////////////////////////////////////////////////////////////////////////////////
    22version="$Id$";
    3 category = "Commutative algebra";
     3category = "Commutative Algebra";
    44info="
    5 LIBRARY:  assPrimes.lib    associated primes of a zero-dimensional ideal
     5LIBRARY:  assprimeszerodim.lib   associated primes of a zero-dimensional ideal
    66
    77AUTHORS:  N. Idrees       nazeranjawwad@gmail.com
     
    1111OVERVIEW:
    1212
    13   A library for computing the associated primes  and the radical of a
     13  A library for computing the associated primes and the radical of a
    1414  zero-dimensional ideal in the polynomial ring over the rational numbers,
    15   Q[x_1,...,x_n] using modular computations.
     15  Q[x_1,...,x_n], using modular computations.
    1616
    1717SEE ALSO: primdec_lib
    1818
    1919PROCEDURES:
     20 zeroR(I);             computes the radical of I
    2021 assPrimes(I);         computes the associated primes of I
    21  zeroR(I);             compute the radical of I
    2222";
    2323
     
    3030"USAGE:  zeroR(I,[n]); I ideal, optional: n number of processors (for parallel computing)
    3131ASSUME:  I is zero-dimensional in Q[variables]
     32NOTE:    Parallelization is just applicable using 32-bit Singular version since
     33         MP-links are not compatible with 64-bit Singular version.
    3234RETURN:  the radical of I
    3335EXAMPLE: example zeroR; shows an example
     
    6466
    6567//--------------------  Initialize the list of primes  -------------------------
    66 // nach Umstellung von modstd.lib auf unsere neue Version: primeList(I,10)
    67    intvec L = primeList(10);
     68   intvec L = primeList(I,10);
    6869   L[5] = prime(random(100000000,536870912));
    6970
     
    141142      }
    142143
    143       //hier deleteUnlucky einbauen, streichen, wenn der Grad nicht stimmt
     144      // insert deleteUnluckyPrimes
    144145      G = chinrem(CO1,CO2);
    145146      N = CO2[1];
     
    160161
    161162         j = size(L) + 1;
    162 
    163 // nach Umstellung von modstd.lib auf unsere neue Version: primeList(I,10,L)
    164          L = primeList(10,L);
     163         L = primeList(I,10,L);
    165164
    166165         if(n > 1)
     
    198197
    199198proc assPrimes(list #)
    200 "USAGE:  assPrimes(I,[n],[a]); I ideal or module,
     199"USAGE:  assPrimes(I,[a],[n]); I ideal or module,
    201200         optional: n number of processors (for parallel computing), a
    202          - a=1: method of Eisenbud/Hunecke/Vasconcelos
    203          - a=2: method of Gianni/Trager/Zacharias
    204          - a=3: mathod of Monico
    205          assPrimes(I)  chooses n=a=1
     201         - a = 1: method of Eisenbud/Hunecke/Vasconcelos
     202         - a = 2: method of Gianni/Trager/Zacharias
     203         - a = 3: mathod of Monico
     204         assPrimes(I) chooses n = a = 1
    206205ASSUME:  I is zero-dimensional over Q[variables]
     206NOTE:    Parallelization is just applicable using 32-bit Singular version since
     207         MP-links are not compatible with 64-bit Singular version.
    207208RETURN:  a list pr of associated primes of I:
    208209EXAMPLE: example assPrimes; shows an example
     
    214215
    215216   ideal I;
    216    if(typeof(#[1])=="ideal")
     217   if(typeof(#[1]) == "ideal")
    217218   {
    218219      I = #[1];
     
    223224      I = Ann(M);
    224225   }
     226   
     227   //---------------------  Initialize optional parameter  ------------------------
     228   if(size(#) > 1)
     229   {
     230      if(size(#) == 2)
     231      {
     232         int alg = #[2];
     233         int n = 1;
     234      }
     235      if(size(#) == 3)
     236      {
     237         int alg = #[2];
     238         int n = #[3];
     239         if((n > 1) && (1 - system("with","MP")))
     240         {
     241            "========================================================================";
     242            "There is no MP available on your system. Since this is necessary to     ";
     243            "parallelize the algorithm, the computation will be done without forking.";
     244            "========================================================================";
     245            n = 1;
     246         }
     247      }
     248   }
     249   else
     250   {
     251      int alg = 1;
     252      int n = 1;
     253   }
    225254
    226255   def SPR = basering;
    227    I = std(I);
     256   I = modStd(I,n);
    228257   int d = vdim(I);
    229258   if(d == -1) { ERROR("Ideal is not zero-dimensional."); }
     
    263292      "CPU-time for radical-check is "+string(timer - T)+" seconds.";
    264293   }
    265 //---------------------  Initialize optional parameter  ------------------------
    266    if(size(#) > 1)
    267    {
    268       if(size(#) == 2)
    269       {
    270          int alg = #[2];
    271          int n = 1;
    272       }
    273       if(size(#) == 3)
    274       {
    275          int alg = #[2];
    276          int n = #[3];
    277          if((n > 1) && (1 - system("with","MP")))
    278          {
    279             "========================================================================";
    280             "There is no MP available on your system. Since this is necessary to     ";
    281             "parallelize the algorithm, the computation will be done without forking.";
    282             "========================================================================";
    283             n = 1;
    284          }
    285       }
    286    }
    287    else
    288    {
    289       int alg = 1;
    290       int n = 1;
    291    }
    292294
    293295   export(SPR);
     
    297299   export(I_for_fork);           // I available for each link
    298300
     301//--------------------  Initialize the list of primes  -------------------------
     302   intvec L = primeList(I,10);
     303   L[5] = prime(random(1000000000,2134567879));
     304
    299305   list Re;
    300306
     
    308314   int j = 1;
    309315   int index = 1;
    310 
    311 
    312 //--------------------  Initialize the list of primes  -------------------------
    313 // nach Umstellung von modstd.lib auf unsere neue Version: primeList(I,10)
    314    intvec L = primeList(10);
    315    L[5] = prime(random(1000000000,2134567879));
    316316
    317317//-----  If there is more than one processor available, we parallelize the  ----
     
    359359            for(i = 1; i <= n; i++)
    360360            {
    361                if(status(l(i), "read", "ready"))                         // ask if link l(i) is ready otherwise sleep for t seconds
     361               if(status(l(i), "read", "ready"))           // ask if link l(i) is ready otherwise sleep for t seconds
    362362               {
    363                   P = read(l(i));                                        // read the result from l(i)
     363                  P = read(l(i));                          // read the result from l(i)
    364364                  CO1[index] = P[1];
    365365                  CO2[index] = bigint(P[2]);
     
    378378               }
    379379            }
    380             if(k == n)                                                  // k describes the number of closed links
     380            if(k == n)                                     // k describes the number of closed links
    381381            {
    382382               j++;
     
    401401         "CPU-time for computing list in assPrimes is "+string(timer - tt)+" seconds.";
    402402      }
    403       //hier deleteUnlucky einbauen, streichen, wenn der Grad nicht stimmt
     403     
     404      // insert deleteUnluckyPrimes
    404405      G = chinrem(CO1,CO2);
    405406      N = CO2[1];
     
    461462                  {
    462463                     H[1][i] = quickSubst(H[1][i],f,I);
    463 
    464                      if(typeof(#[1])=="ideal")
    465                      {
    466                         Re[i-1] = #[1] + ideal(H[1][i]);
    467                      }
    468                      else
    469                      {
    470                         Re[i-1] = M + H[1][i]*freemodule(nrows(M));
    471                      }
     464                     Re[i-1] = I + ideal(H[1][i]);
    472465                  }
    473466
     
    514507      j = size(L) + 1;
    515508
    516 // nach Umstellung von modstd.lib auf unsere neue Version: primeList(I,10,L)
    517       L = primeList(10,L);
     509      setring(SPR);
     510      L = primeList(I,10,L);
     511      setring rHelp;
    518512
    519513      if(n > 1)
     
    746740////////////////////////////////////////////////////////////////////////////////
    747741
    748 static proc primeList(int n, list #)
    749 "USAGE:  primeList(n); (resp. primeList(n,L); )
    750 RETURN: the intvec of n greatest primes  <= 536870912 (resp. n greatest
    751         primes < L[size(L)] union with L)
    752 EXAMPLE:example primList; shows an example
    753 "
    754 {
    755    intvec L;
    756    int i,p;
    757    if(size(#) == 0)
    758    {
    759       p = prime(536870912);
    760       L[1] = p;
    761    }
    762    else
    763    {
    764       L = #[1];
    765       p = prime(L[size(L)]-1);
    766       L[size(L)+1] = p;
    767    }
    768    if(p == 2){ERROR("no more primes");}
    769    for(i = 2; i <= n; i++)
    770    {
    771       p = prime(p-1);
    772       L[size(L)+1] = p;
    773    }
    774    return(L);
    775 }
    776 example
    777 { "EXAMPLE:"; echo = 2;
    778    intvec L=primeList(10);
    779    size(L);
    780    L[size(L)];
    781    L=primeList(5,L);
    782    size(L);
    783    L[size(L)];
    784 }
    785 
    786 ////////////////////////////////////////////////////////////////////////////////
    787 
    788742static proc zeroRadP(ideal I, int p)
    789743{
     
    874828
    875829//Test for zeroR
    876 ring R = 0, (x,y), dp;
     830ring R = 0,(x,y),dp;
    877831ideal I = xy4-2xy2+x, x2-x, y4-2y2+1;
    878832
    879833//Cyclic 6
    880 ring R=0,x(1..6),dp;
    881 ideal I=cyclic(6);
     834ring R = 0,x(1..6),dp;
     835ideal I = cyclic(6);
    882836
    883837//Amrhei
    884 ring R=0,(a,b,c,d,e,f),dp;
    885 ideal I=
    886 2fb+2ec+d2+a2+a,
    887 2fc+2ed+2ba+b,
    888 2fd+e2+2ca+c+b2,
    889 2fe+2da+d+2cb,
    890 f2+2ea+e+2db+c2,
    891 2fa+f+2eb+2dc;
     838ring R = 0,(a,b,c,d,e,f),dp;
     839ideal I = 2fb+2ec+d2+a2+a,
     840          2fc+2ed+2ba+b,
     841          2fd+e2+2ca+c+b2,
     842          2fe+2da+d+2cb,
     843          f2+2ea+e+2db+c2,
     844          2fa+f+2eb+2dc;
    892845
    893846
    894847//Becker-Niermann
    895848ring R = 0,(x,y,z),dp;
    896 ideal I=
    897 x2+xy2z-2xy+y4+y2+z2,
    898 -x3y2+xy2z+xyz3-2xy+y4,
    899 -2x2y+xy4+yz4-3;
     849ideal I = x2+xy2z-2xy+y4+y2+z2,
     850          -x3y2+xy2z+xyz3-2xy+y4,
     851          -2x2y+xy4+yz4-3;
    900852
    901853//Roczen
    902 ring R=0,(a,b,c,d,e,f,g,h,k,o),dp;
    903 ideal I=
    904 o+1,
    905 k4+k,
    906 hk,
    907 h4+h,
    908 gk,
    909 gh,
    910 g3+h3+k3+1,
    911 fk,
    912 f4+f,
    913 eh,
    914 ef,
    915 f3h3+e3k3+e3+f3+h3+k3+1,
    916 e3g+f3g+g,
    917 e4+e,
    918 dh3+dk3+d,
    919 dg,
    920 df,
    921 de,
    922 d3+e3+f3+1,
    923 e2g2+d2h2+c,
    924 f2g2+d2k2+b,
    925 f2h2+e2k2+a;
     854ring R = 0,(a,b,c,d,e,f,g,h,k,o),dp;
     855ideal I = o+1, k4+k, hk, h4+h, gk, gh, g3+h3+k3+1,
     856          fk, f4+f, eh, ef, f3h3+e3k3+e3+f3+h3+k3+1,
     857          e3g+f3g+g, e4+e, dh3+dk3+d, dg, df, de,
     858          d3+e3+f3+1, e2g2+d2h2+c, f2g2+d2k2+b,
     859          f2h2+e2k2+a;
    926860
    927861//4 bodies with equal masses, before symmetrisation.
    928862//We are looking for the real positive solutions
    929 ring R=0,(B,D,F,b,d,f),dp;
    930 
    931 ring R=0,(B,b,D,d,F,f),dp;
    932 ideal I=(b-d)*(B-D)-2*F+2,
    933 (b-d)*(B+D-2*F)+2*(B-D),
    934 (b-d)^2-2*(b+d)+f+1,
    935 B^2*b^3-1,D^2*d^3-1,F^2*f^3-1;
    936 
    937 ring R=0,(B,b,D,d,F,f),dp;
    938 ideal I=(b-d)*(B-D)-F+1,
    939 (b-d)*(B+D-F)+(B-D),
    940 (b-d)^2-(b+d)+f+1,
    941 B^2*b^3-1,D^2*d^3-1,F^2*f^3-1;
     863ring R = 0,(B,b,D,d,F,f),dp;
     864ideal I = (b-d)*(B-D)-2*F+2,
     865          (b-d)*(B+D-2*F)+2*(B-D),
     866          (b-d)^2-2*(b+d)+f+1,
     867          B^2*b^3-1,D^2*d^3-1,F^2*f^3-1;
     868
     869ring R = 0,(B,b,D,d,F,f),dp;
     870ideal I = (b-d)*(B-D)-F+1,
     871          (b-d)*(B+D-F)+(B-D),
     872          (b-d)^2-(b+d)+f+1,
     873          B^2*b^3-1,D^2*d^3-1,F^2*f^3-1;
    942874
    943875
    944876//prime
    945 ring R=0,(x,y,z,t,u),dp;
    946 
    947 ideal I=2x2-2y2+2z2-2t2+2u2-1,
     877ring R = 0,(x,y,z,t,u),dp;
     878ideal I = 2x2-2y2+2z2-2t2+2u2-1,
    948879          2x3-2y3+2z3-2t3+2u3-1,
    949          2x4-2y4+2z4-2t4+2u4-1,
    950          2x5-2y5+2z5-2t5+2u5-1,
    951          2x6-2y6+2z6-2t6+2u6-1;
     880          2x4-2y4+2z4-2t4+2u4-1,
     881          2x5-2y5+2z5-2t5+2u5-1,
     882          2x6-2y6+2z6-2t6+2u6-1;
    952883
    953884*/
Note: See TracChangeset for help on using the changeset viewer.