Changeset 4cc3cac in git for Singular/LIB/modstd.lib


Ignore:
Timestamp:
Oct 15, 2010, 5:14:22 PM (14 years ago)
Author:
Stefan Steidel <steidel@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
f5c66c42df72194ae4742e5389d25c7b955a5d4b
Parents:
aa1c72974a2501d06feacf3b3acebe16d3e1ef6f
Message:
Variants in main procedure modStd modified and documentation adapted.

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

Legend:

Unmodified
Added
Removed
  • Singular/LIB/modstd.lib

    raa1c72 r4cc3cac  
    33category = "Commutative Algebra";
    44info="
    5 LIBRARY:  modstd.lib  Groebner basis of ideals
     5LIBRARY:  modstd.lib      Groebner basis of ideals
    66
    77AUTHORS:  A. Hashemi      Amir.Hashemi@lip6.fr
     
    2020PROCEDURES:
    2121 modStd(I);        standard basis of I using modular methods (chinese remainder)
     22 modS(I,L);        liftings to Q of standard bases of I mod p for p in L
    2223 modHenselStd(I);  standard basis of I using modular methods (hensel lifting)
    23  modS(I,L);        liftings to Q of standard bases of I mod p for p in L
    2424";
    2525
    2626LIB "poly.lib";
    2727LIB "ring.lib";
     28
     29////////////////////////////////////////////////////////////////////////////////
     30
     31static proc mixedTest()
     32// decides whether the ordering of the basering is mixed
     33{
     34   int i,p,m;
     35   for(i = 1; i <= nvars(basering); i++)
     36   {
     37      if(var(i) > 1)
     38      {
     39         p++;
     40      }
     41      else
     42      {
     43         m++;
     44      }
     45   }
     46   if((p > 0) && (m > 0)) { return(1); }
     47   return(0);
     48}
    2849
    2950////////////////////////////////////////////////////////////////////////////////
     
    4465"
    4566{
     67   def R = basering;
     68   setring R;
     69   
    4670   attrib(J,"isSB",1);
    4771   int i,j,k;
     
    5074   {
    5175      int n = #[1];
    52       if((n > 1) && (n < ncols(I)) && system("with","MP"))
     76      if(n >= ncols(I)) { n = ncols(I); }
     77      if((n > 1) && system("with","MP"))
    5378      {
    5479         for(i = 1; i <= n - 1; i++)
    5580         {
    5681            link l(i) = "MPtcp:fork";
     82            //link l(i) = "ssi:fork";
    5783            open(l(i));
     84           
    5885            write(l(i), quote(redFork(eval(I[ncols(I)-i]), eval(J), 1)));
    5986         }
     
    79106            {
    80107               if(status(l(i), "read", "ready"))
    81                {
     108               { 
    82109                  if(read(l(i)) != 0)
    83110                  {
     
    225252proc deleteUnluckyPrimes(list T, list L, int ho, list #)
    226253"USAGE:  deleteUnluckyPrimes(T,L,ho,#); T/L list of polys/primes, ho integer
    227 RETURN:  lists T,L(,M),lT with T/L(/M) list of polys/primes(/type of #), lT ideal
     254RETURN:  lists T,L(,M),lT with T/L(/M) list of polys/primes(/type of #),
     255         lT ideal
    228256NOTE:    - if ho = 1, the polynomials in T are homogeneous, else ho = 0,
    229257         - lT is prevalent, i.e. the most appearing leading ideal in T
     
    351379"USAGE:  primeList(I,n); ( resp. primeList(I,n,L); ) I ideal, n integer
    352380RETURN:  the intvec of n greatest primes  <= 2147483647 (resp. n greatest primes
    353          < L[size(L)] union with L) such that none ot these primes divides any
     381         < L[size(L)] union with L) such that none of these primes divides any
    354382         coefficient occuring in I
    355383EXAMPLE: example primList; shows an example
     
    490518"USAGE:  modpStd(I,p,variant,#); I ideal, p integer, variant integer
    491519ASSUME:  If size(#) > 0, then #[1] is an intvec describing the Hilbert series.
    492 RETURN:  ideal - a standard basis of I mod p, integer - p (, matrix - if variant
    493          = 5, the transformation matrix obtained from liftstd)
     520RETURN:  ideal - a standard basis of I mod p, integer - p
    494521NOTE:    The procedure computes a standard basis of the ideal I modulo p and
    495522         fetches the result to the basering. If size(#) > 0 the Hilbert driven
     
    497524         The standard basis computation modulo p does also vary depending on the
    498525         integer variant, namely
    499 @*       - variant = 1: std(.,#[1]) resp. groebner,
    500 @*       - variant = 2: groebner,
    501 @*       - variant = 3: homogenize - std(.,#[1]) resp. groebner - dehomogenize,
    502 @*       - variant = 4: std(.,#[1]) resp. groebner,
    503 @*       - variant = 5: liftstd1.
     526@*       - variant = 1/4: std(.,#[1]) resp. groebner,
     527@*       - variant = 2/5: groebner,
     528@*       - variant = 3/6: homog. - std(.,#[1]) resp. groebner - dehomog..
    504529EXAMPLE: example modpStd; shows an example
    505530"
     
    526551      }
    527552   }
    528    if(variant == 2)
     553   
     554   if((variant == 2) || (variant == 5))
    529555   {
    530556      i = groebner(i);
    531557   }
    532558
    533    if(variant == 3)
     559   if((variant == 3) || (variant == 6))
    534560   {
    535561      list rl = ringlist(@r);
     
    577603      kill HomR;
    578604   }
    579 
    580    if(variant == 5)
    581    {
    582       matrix trans;
    583       i,trans = liftstd1(i);
    584       setring R0;
    585       return(list(fetch(@r,i),p,fetch(@r,trans)));
    586    }
    587 
     605   
    588606   setring R0;
    589607   return(list(fetch(@r,i),p));
     
    596614   list P = modpStd(I,p,5);
    597615   P;
    598    matrix(P[1])-matrix(I)*P[3];
    599616
    600617   int q = 32003;
     
    608625"USAGE:  modStd(I); I ideal
    609626ASSUME:  If size(#) > 0, then # contains either 1, 2 or 4 integers such that
    610 @*       - #[1] is the number of available processors for the computation,
     627@*       - #[1] is the number of available processors for the computation
     628                (parallelization is just applicable using 32-bit Singular
     629                version since MP-links are not compatible with 64-bit Singular
     630                version),
    611631@*       - #[2] is an optional parameter for the exactness of the computation,
    612632                if #[2] = 1, the procedure computes a standard basis for sure,
     
    619639         result is a standard basis containing I and with high probability
    620640         a standard basis of I.
    621          By default the procedure computes a standard basis of I with high
    622          probability, but if the optional parameter #[2] = 1, it is exact.
     641         By default the procedure computes a standard basis of I for sure, but
     642         if the optional parameter #[2] = 0, it computes a standard basis of I
     643         with high probability and a warning appears at the end.
    623644         The procedure distinguishes between different variants for the standard
    624645         basis computation in positive characteristic depending on the ordering
     
    630651                        > 1 block) and exactness = 0,
    631652@*       - variant = 4, if I is homogeneous and exactness = 1,
    632 @*       - variant = 5, if I is not homogeneous and exactness = 1.
     653@*       - variant = 5, if I is not homogeneous, 1-block-ordering and
     654                        exactness = 1,
     655@*       - variant = 3, if I is not homogeneous, complicated ordering (lp or
     656                        > 1 block) and exactness = 1.
    633657EXAMPLE: example modStd; shows an example
    634658"
     
    641665   if((npars(R0) > 0) || (rl[1] > 0))
    642666   {
    643       ERROR("characteristic of basering should be zero, basering should have no parameters");
     667      ERROR("Characteristic of basering should be zero, basering should
     668             have no parameters.");
    644669   }
    645670
     
    648673   int pd = printlevel-voice+2;
    649674   int j = 1;
    650    int pTest;
     675   int pTest, sizeTest;
    651676   int en = 2134567879;
    652677   int an = 1000000000;
     
    661686         if((n1 > 1) && (1 - system("with","MP")))
    662687         {
    663             "========================================================================";
    664             "There is no MP available on your system. Since this is necessary to     ";
    665             "parallelize the algorithm, the computation will be done without forking.";
    666             "========================================================================";
     688     "========================================================================";
     689     "There is no MP available on your system. Since this is necessary to     ";
     690     "parallelize the algorithm, the computation will be done without forking.";
     691     "========================================================================";
    667692            n1 = 1;
    668693         }
    669          int exactness = 0;
     694         int exactness = 1;
    670695         int n2 = 10;
    671696         int n3 = 10;
     
    676701         if((n1 > 1) && (1 - system("with","MP")))
    677702         {
    678             "========================================================================";
    679             "There is no MP available on your system. Since this is necessary to     ";
    680             "parallelize the algorithm, the computation will be done without forking.";
    681             "========================================================================";
     703     "========================================================================";
     704     "There is no MP available on your system. Since this is necessary to     ";
     705     "parallelize the algorithm, the computation will be done without forking.";
     706     "========================================================================";
    682707            n1 = 1;
    683708         }
     
    691716         if((n1 > 1) && (1 - system("with","MP")))
    692717         {
    693             "========================================================================";
    694             "There is no MP available on your system. Since this is necessary to     ";
    695             "parallelize the algorithm, the computation will be done without forking.";
    696             "========================================================================";
     718     "========================================================================";
     719     "There is no MP available on your system. Since this is necessary to     ";
     720     "parallelize the algorithm, the computation will be done without forking.";
     721     "========================================================================";
    697722            n1 = 1;
    698723         }
     
    705730   {
    706731      int n1 = 1;
    707       int exactness = 0;
     732      int exactness = 1;
    708733      int n2 = 10;
    709734      int n3 = 10;
     
    712737//-------------------------  Save current options  -----------------------------
    713738   intvec opt = option(get);
    714 
     739   
    715740   option(redSB);
    716741
     
    726751   int rt = rtimer;
    727752
    728    if(h)
    729    {
    730       if(exactness == 0) { variant = 1; if(printlevel >= 10) { "variant = 1"; } }
    731       if(exactness == 1) { variant = 4; if(printlevel >= 10) { "variant = 4"; } }
    732       rl[1] = L[5];
    733       def @r = ring(rl);
    734       setring @r;
    735       def @s = changeord("dp");
    736       setring @s;
    737       ideal I = std(fetch(R0,I));
    738       intvec hi = hilb(I,1);
    739       setring R0;
    740       kill @r,@s;
    741    }
    742    else
    743    {
    744       if(exactness == 0)
     753   if(!mixedTest())
     754   {
     755      if(h)
     756      {
     757         if(exactness == 0)
     758         {
     759            variant = 1;
     760            if(printlevel >= 10) { "variant = 1"; }
     761         }
     762         if(exactness == 1)
     763         {
     764            variant = 4;
     765            if(printlevel >= 10) { "variant = 4"; }
     766         }
     767         rl[1] = L[5];
     768         def @r = ring(rl);
     769         setring @r;
     770         def @s = changeord("dp");
     771         setring @s;
     772         ideal I = std(fetch(R0,I));
     773         intvec hi = hilb(I,1);
     774         setring R0;
     775         kill @r,@s;
     776      }
     777      else
    745778      {
    746779         string ordstr_R0 = ordstr(R0);
     
    749782         if((find(ordstr_R0, "M") > 0) || (find(ordstr_R0, "a") > 0) || neg)
    750783         {
    751             variant = 2;
    752             if(printlevel >= 10) { "variant = 2"; }
     784            if(exactness == 0)
     785            {
     786               variant = 2;
     787               if(printlevel >= 10) { "variant = 2"; }
     788            }
     789            if(exactness == 1)
     790            {
     791               variant = 5;
     792               if(printlevel >= 10) { "variant = 5"; }
     793            }
    753794         }
    754795         else
     
    757798            if(system("nblocks") <= 2)
    758799            {
    759                if(find(ordstr_R0, "M") + find(ordstr_R0, "lp") + find(ordstr_R0, "rp") <= 0)
     800               if(find(ordstr_R0, "M") + find(ordstr_R0, "lp")
     801                                       + find(ordstr_R0, "rp") <= 0)
    760802               {
    761803                  order = "simple";
     
    765807            if((order == "simple") || (size(rl) > 4))
    766808            {
    767                variant = 2;
    768                if(printlevel >= 10) { "variant = 2"; }
     809               if(exactness == 0)
     810               {
     811                  variant = 2;
     812                  if(printlevel >= 10) { "variant = 2"; }
     813               }
     814               if(exactness == 1)
     815               {
     816                  variant = 5;
     817                  if(printlevel >= 10) { "variant = 5"; }
     818               }
    769819            }
    770820            else
    771821            {
    772                variant = 3;
    773                if(printlevel >= 10) { "variant = 3"; }
     822               if(exactness == 0)
     823               {
     824                  variant = 3;
     825                  if(printlevel >= 10) { "variant = 3"; }
     826               }
     827               if(exactness == 1)
     828               {
     829                  variant = 6;
     830                  if(printlevel >= 10) { "variant = 6"; }
     831               }
     832       
    774833               rl[1] = L[5];
    775834               def @r = ring(rl);
     
    796855         }
    797856      }
    798 
    799       if(exactness == 1)
    800       {
    801          variant = 5;
    802          if(printlevel >= 10) { "variant = 5"; }
    803          "=============================================================";
    804          "WARNING: This variant is not applicable if ordering is mixed.";
    805          "=============================================================";
    806          matrix trans;
    807       }
    808    }
    809 
     857   }
     858   else
     859   {
     860      if(exactness == 1) { return(groebner(I)); }
     861      if(h)
     862      {
     863         variant = 1; if(printlevel >= 10) { "variant = 1"; }
     864         rl[1] = L[5];
     865         def @r = ring(rl);
     866         setring @r;
     867         def @s = changeord("dp");
     868         setring @s;
     869         ideal I = std(fetch(R0,I));
     870         intvec hi = hilb(I,1);
     871         setring R0;
     872         kill @r,@s;
     873      }
     874      else
     875      {
     876         string ordstr_R0 = ordstr(R0);
     877         int neg = 1 - attrib(R0,"global");
     878
     879         if((find(ordstr_R0, "M") > 0) || (find(ordstr_R0, "a") > 0) || neg)
     880         {
     881            variant = 2;
     882            if(printlevel >= 10) { "variant = 2"; }
     883         }
     884         else
     885         {
     886            string order;
     887            if(system("nblocks") <= 2)
     888            {
     889               if(find(ordstr_R0, "M") + find(ordstr_R0, "lp")
     890                                       + find(ordstr_R0, "rp") <= 0)
     891               {
     892                  order = "simple";
     893               }
     894            }
     895
     896            if((order == "simple") || (size(rl) > 4))
     897            {
     898               variant = 2;
     899               if(printlevel >= 10) { "variant = 2"; }
     900            }
     901            else
     902            {
     903               variant = 3;
     904               if(printlevel >= 10) { "variant = 3"; }
     905       
     906               rl[1] = L[5];
     907               def @r = ring(rl);
     908               setring @r;
     909               int nvar@r = nvars(@r);
     910               intvec w;
     911               for(i = 1; i <= nvar@r; i++)
     912               {
     913                  w[i] = deg(var(i));
     914               }
     915               w[nvar@r + 1] = 1;
     916
     917               list hiRi = hilbRing(fetch(R0,I),w);
     918               intvec W = hiRi[2];
     919               def @s = hiRi[1];
     920               setring @s;
     921
     922               Id(1) = std(Id(1));
     923               intvec hi = hilb(Id(1), 1, W);
     924
     925               setring R0;
     926               kill @r,@s;
     927            }
     928         }
     929      }
     930   }
     931 
    810932   list P,T1,T2,T3,LL;
    811933
     
    827949         link l(i) = "MPtcp:fork";
    828950         open(l(i));
    829          if((variant == 1) || (variant == 3) || (variant == 4))
    830          {
    831             write(l(i), quote(modpStd(I_for_fork, eval(L[i + 1]), eval(variant), eval(hi))));
     951         if((variant == 1) || (variant == 3) ||
     952            (variant == 4) || (variant == 6))
     953         {
     954            write(l(i), quote(modpStd(I_for_fork, eval(L[i + 1]),
     955                                                  eval(variant), eval(hi))));
    832956         }
    833957         if((variant == 2) || (variant == 5))
    834958         {
    835             write(l(i), quote(modpStd(I_for_fork, eval(L[i + 1]), eval(variant))));
     959            write(l(i), quote(modpStd(I_for_fork, eval(L[i + 1]),
     960                                                  eval(variant))));
    836961         }
    837962      }
    838963
    839964      int t = timer;
    840       if((variant == 1) || (variant == 3) || (variant == 4))
     965      if((variant == 1) || (variant == 3) || (variant == 4) || (variant == 6))
    841966      {
    842967         P = modpStd(I_for_fork, L[1], variant, hi);
     
    851976      T1[1] = P[1];
    852977      T2[1] = bigint(P[2]);
    853       if(variant == 5) { T3[1] = P[3]; }
    854978      index++;
    855979
     
    871995            for(i = 1; i <= n1; i++)
    872996            {
    873                if(status(l(i), "read", "ready"))                         // ask if link l(i) is ready otherwise sleep for t seconds
     997               //--- ask if link l(i) is ready otherwise sleep for t seconds ---
     998               if(status(l(i), "read", "ready"))                     
    874999               {
    875                   P = read(l(i));                                        // read the result from l(i)
     1000                  //--- read the result from l(i) ---
     1001                  P = read(l(i));                                     
    8761002                  T1[index] = P[1];
    8771003                  T2[index] = bigint(P[2]);
    878                   if(variant == 5) { T3[index] = P[3]; }
    8791004                  index++;
    8801005
    8811006                  if(j <= size(L))
    8821007                  {
    883                      if((variant == 1) || (variant == 3) || (variant == 4))
     1008                     if((variant == 1) || (variant == 3) ||
     1009                        (variant == 4) || (variant == 6))
    8841010                     {
    885                         write(l(i), quote(modpStd(I_for_fork, eval(L[j]), eval(variant), eval(hi))));
     1011                        write(l(i), quote(modpStd(I_for_fork, eval(L[j]),
     1012                                                  eval(variant), eval(hi))));
    8861013                        j++;
    8871014                     }
    8881015                     if((variant == 2) || (variant == 5))
    8891016                     {
    890                         write(l(i), quote(modpStd(I_for_fork, eval(L[j]), eval(variant))));
     1017                        write(l(i), quote(modpStd(I_for_fork,
     1018                                                  eval(L[j]), eval(variant))));
    8911019                        j++;
    8921020                     }
     
    8991027               }
    9001028            }
    901             if(k == n1)                                                   // k describes the number of closed links
     1029            //--- k describes the number of closed links ---
     1030            if(k == n1)                                               
    9021031            {
    9031032               j++;
     
    9101039         while(j <= size(L))
    9111040         {
    912             if((variant == 1) || (variant == 3) || (variant == 4))
     1041            if((variant == 1) || (variant == 3) ||
     1042               (variant == 4) || (variant == 6))
    9131043            {
    9141044               P = modpStd(I, L[j], variant, hi);
     
    9211051            T1[index] = P[1];
    9221052            T2[index] = bigint(P[2]);
    923             if(variant == 5) { T3[index] = P[3]; }
    9241053            index++;
    9251054            j++;
     
    9331062      }
    9341063
    935       if(pd>2){"lifting";}
     1064      if(pd > 2) { "lifting"; }
    9361065
    9371066//------------------------  Delete unlucky primes  -----------------------------
    9381067//-------------  unlucky if and only if the leading ideal is wrong  ------------
    9391068
    940       if(variant == 5) { LL = deleteUnluckyPrimes(T1,T2,h,T3); T3 = LL[3]; }
    941       else { LL = deleteUnluckyPrimes(T1,T2,h); }
     1069      LL = deleteUnluckyPrimes(T1,T2,h);
    9421070      T1 = LL[1];
    9431071      T2 = LL[2];
     
    9501078      H = chinrem(T1,T2);
    9511079      J = farey(H,N);
    952       if(variant == 5) { trans = farey(chinrem(T3,T2), N); }
    9531080
    9541081//----------------  Test if we already have a standard basis of I --------------
    9551082
    9561083      tt = timer; rt = rtimer;
    957       if(pd > 2){ "list of primes:"; L; "pTest" ;}
    958       if((variant == 1) || (variant == 3) || (variant == 4)) { pTest = pTestSB(I,J,L,variant,hi); }
    959       if((variant == 2) || (variant == 5)) { pTest = pTestSB(I,J,L,variant); }
     1084      if(pd > 2) { "list of primes:"; L; "pTest"; }
     1085      if((variant == 1) || (variant == 3) || (variant == 4) || (variant == 6))
     1086      {
     1087         pTest = pTestSB(I,J,L,variant,hi);
     1088      }
     1089      if((variant == 2) || (variant == 5))
     1090      {
     1091         pTest = pTestSB(I,J,L,variant);
     1092      }
    9601093
    9611094      if(printlevel >= 10)
     
    9641097         "Real-time for pTest is "+string(rtimer - rt)+" seconds.";
    9651098      }
    966 
     1099 
    9671100      if(pTest)
    9681101      {
    9691102         if(printlevel >= 10)
    9701103         {
    971             "CPU-time for computation without final tests is "+string(timer - TT)+" seconds.";
    972             "Real-time for computation without final tests is "+string(rtimer - RT)+" seconds.";
     1104            "CPU-time for computation without final tests is
     1105            "+string(timer - TT)+" seconds.";
     1106            "Real-time for computation without final tests is
     1107            "+string(rtimer - RT)+" seconds.";
    9731108         }
    9741109
    9751110         attrib(J,"isSB",1);
    9761111         tt = timer; rt = rtimer;
    977          int sizeTest = 1 - isIncluded(I,J,n1);
     1112         sizeTest = 1 - isIncluded(I,J,n1);
    9781113
    9791114         if(printlevel >= 10)
    9801115         {
    981             "CPU-time for checking if I subset <G> is "+string(timer - tt)+" seconds.";
    982             "Real-time for checking if I subset <G> is "+string(rtimer - rt)+" seconds.";
     1116            "CPU-time for checking if I subset <G> is
     1117            "+string(timer - tt)+" seconds.";
     1118            "Real-time for checking if I subset <G> is
     1119            "+string(rtimer - rt)+" seconds.";
    9831120         }
    9841121
    9851122         if(sizeTest == 0)
    9861123         {
    987             if(variant == 1)
    988             {
    989                "===================================================================";
    990                "WARNING: Ideal generated by output may be greater than input ideal.";
    991                "===================================================================";
     1124            if((variant == 1) || (variant == 2) || (variant == 3))
     1125            {
     1126               "===========================================================";
     1127               "WARNING: Output might not be a standard basis of the input.";
     1128               "===========================================================";
    9921129               option(set, opt);
    9931130               if(n1 > 1) { kill I_for_fork; }
    9941131               return(J);
    9951132            }
    996             if((variant == 2) || (variant == 3))
     1133            if((variant == 4) || (variant == 5) || (variant == 6))
    9971134            {
    9981135               tt = timer; rt = rtimer;
     
    10011138               if(printlevel >= 10)
    10021139               {
    1003                   "CPU-time for last std-computation is "+string(timer - tt)+" seconds.";
    1004                   "Real-time for last std-computation is "+string(rtimer - rt)+" seconds.";
    1005                }
    1006 
    1007                if(size(reduce(K,J)) == 0)
    1008                {
    1009                   "===================================================================";
    1010                   "WARNING: Ideal generated by output may be greater than input ideal.";
    1011                   "===================================================================";
    1012                   option(set, opt);
    1013                   if(n1 > 1) { kill I_for_fork; }
    1014                   return(J);
    1015                }
    1016             }
    1017             if(variant == 4)
    1018             {
    1019                tt = timer; rt = rtimer;
    1020                K = std(J);
    1021 
    1022                if(printlevel >= 10)
    1023                {
    1024                   "CPU-time for last std-computation is "+string(timer - tt)+" seconds.";
    1025                   "Real-time for last std-computation is "+string(rtimer - rt)+" seconds.";
     1140                  "CPU-time for last std-computation is
     1141                  "+string(timer - tt)+" seconds.";
     1142                  "Real-time for last std-computation is
     1143                  "+string(rtimer - rt)+" seconds.";
    10261144               }
    10271145
     
    10331151               }
    10341152            }
    1035             if(variant == 5)
    1036             {
    1037                tt = timer; rt = rtimer;
    1038                K = std(J);
    1039 
    1040                if(printlevel >= 10)
    1041                {
    1042                   "CPU-time for last std-computation is "+string(timer - tt)+" seconds.";
    1043                   "Real-time for last std-computation is "+string(rtimer - rt)+" seconds.";
    1044                }
    1045 
    1046                if(size(reduce(K,J)) == 0)
    1047                {
    1048                   if(matrix(J) == matrix(I)*trans)
    1049                   {
    1050                      option(set, opt);
    1051                      if(n1 > 1) { kill I_for_fork; }
    1052                      return(J);
    1053                   }
    1054                }
    1055             }
    1056             if(pd>2){"pTest o.k. but result wrong";}
    1057          }
    1058          if(pd>2){"pTest o.k. but result wrong";}
     1153            if(pd > 2) { "pTest o.k. but result wrong"; }
     1154         }
     1155         if(pd > 2) { "pTest o.k. but result wrong"; }
    10591156      }
    10601157
     
    10741171         {
    10751172            open(l(i));
    1076             if((variant == 1) || (variant == 3) || (variant == 4))
    1077             {
    1078                write(l(i), quote(modpStd(I_for_fork, eval(L[j+i-1]), eval(variant), eval(hi))));
     1173            if((variant == 1) || (variant == 3) ||
     1174               (variant == 4) || (variant == 6))
     1175            {
     1176               write(l(i), quote(modpStd(I_for_fork, eval(L[j+i-1]),
     1177                                                     eval(variant), eval(hi))));
    10791178            }
    10801179            if((variant == 2) || (variant == 5))
    10811180            {
    1082                write(l(i), quote(modpStd(I_for_fork, eval(L[j+i-1]), eval(variant))));
     1181               write(l(i), quote(modpStd(I_for_fork, eval(L[j+i-1]),
     1182                                                     eval(variant))));
    10831183            }
    10841184         }
     
    10901190example
    10911191{ "EXAMPLE:"; echo = 2;
    1092    ring r = 0,(x,y,z,t),dp;
     1192   ring R1 = 0,(x,y,z,t),dp;
    10931193   ideal I = 3x3+x2+1, 11y5+y3+2, 5z4+z2+4;
    10941194   ideal J = modStd(I);
     
    10981198   J;
    10991199
    1100    ring s = 0,(x,y,z),ds;
     1200   ring R2 = 0,(x,y,z),ds;
    11011201   ideal I = jacob(x5+y6+z7+xyz);
    1102    ideal J1 = modStd(I,1,1);
     1202   ideal J1 = modStd(I,1,0);
    11031203   J1;
    1104    //requires MP
    1105    //ideal J2 = modStd(I,3);
    1106    //J2;
    1107    //size(reduce(J1,J2));
    1108    //size(reduce(J2,J1));
    1109 
    1110    ring rr = 0,x(1..4),lp;
     1204
     1205   ring R3 = 0,x(1..4),lp;
    11111206   ideal I = cyclic(4);
    11121207   ideal J1 = modStd(I,1);
    1113    ideal J2 = modStd(I,1,1);
     1208   ideal J2 = modStd(I,1,0);
    11141209   size(reduce(J1,J2));
    11151210   size(reduce(J2,J1));
     1211   
     1212   /*
     1213   ring R4 = 0,x(1..4),wp(1,-1,-1,1);
     1214   ideal I = cyclic(4);
     1215   ideal J1 = modStd(I,1,0);
     1216   */
    11161217}
    11171218
     
    11341235   list T;
    11351236   list rl = ringlist(R0);
    1136    if((npars(R0)>0) || (rl[1]>0)) { ERROR("characteristic of basering should be zero"); }
     1237   if((npars(R0)>0) || (rl[1]>0))
     1238   {
     1239      ERROR("Characteristic of basering should be zero.");
     1240   }
    11371241   for(j = 1; j <= size(L); j++)
    11381242   {
     
    11541258      kill @r;
    11551259   }
    1156    L = deleteUnluckyPrimes(T,L,homog(I)); // unlucky if and only if the leading ideal is wrong
     1260   L = deleteUnluckyPrimes(T,L,homog(I));
     1261   // unlucky if and only if the leading ideal is wrong
    11571262   J = farey(chinrem(L[1],L[2]),N);
    11581263   attrib(J,"isSB",1);
     
    13401445int c = 4;
    13411446int t = 1;
    1342 poly f = x^a+y^b+z^(3*c)+x^(c+2)*y^(c-1)+x^(c-1)*y^(c-1)*z3+x^(c-2)*y^c*(y2+t*x)^2;
     1447poly f = x^a+y^b+z^(3*c)+x^(c+2)*y^(c-1)+x^(c-1)*y^(c-1)*z3
     1448         +x^(c-2)*y^c*(y2+t*x)^2;
    13431449ideal i = jacob(f);
    13441450
     
    13481454int c = 5;
    13491455int t = 1;
    1350 poly f = x^a+y^b+z^(3*c)+x^(c+2)*y^(c-1)+x^(c-1)*y^(c-1)*z3+x^(c-2)*y^c*(y2+t*x)^2;
     1456poly f = x^a+y^b+z^(3*c)+x^(c+2)*y^(c-1)+x^(c-1)*y^(c-1)*z3
     1457         +x^(c-2)*y^c*(y2+t*x)^2;
    13511458ideal i = jacob(f),f;
    13521459
     
    13631470int beta = 5;
    13641471int t = 1;
    1365 poly f = x^a+y^b+z^c+x^alpha*y^(beta-5)+x^(alpha-2)*y^(beta-3)+x^(alpha-3)*y^(beta-4)*z^2+x^(alpha-4)*y^(beta-4)*(y^2+t*x)^2;
     1472poly f = x^a+y^b+z^c+x^alpha*y^(beta-5)+x^(alpha-2)*y^(beta-3)
     1473         +x^(alpha-3)*y^(beta-4)*z^2+x^(alpha-4)*y^(beta-4)*(y^2+t*x)^2;
    13661474ideal i = jacob(f);
    13671475*/
Note: See TracChangeset for help on using the changeset viewer.