Changeset bd7468 in git


Ignore:
Timestamp:
Feb 24, 2007, 4:09:51 PM (17 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', 'b324714bf5073469800caef737deba1366fbd81f')
Children:
101775c32e4f8f7cd743c23b9822bc53abca1792
Parents:
2abb041913e22b03ba7227d2705d03a49a7de82a
Message:
*greuel: new standard.lib


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

Legend:

Unmodified
Added
Removed
  • Singular/LIB/standard.lib

    r2abb041 rbd7468  
    11//////////////////////////////////////////////////////////////////////////////
    22//major revision Jan/Feb. 2007, GMG
     3//groebner mit Optionen versehen
    34//////////////////////////////////////////////////////////////////////////////
    4 version="$Id: standard.lib,v 1.87 2007-02-04 11:37:35 Singular Exp $";
     5version="$Id: standard.lib,v 1.88 2007-02-24 15:09:51 Singular Exp $";
    56category="Miscellaneous";
    67info="
     
    1718 weightKB(stc,dd,vl)    degree dd part of a kbase wrt. some weigths
    1819";
    19 
    20 // quotientList(L,...)    a list, say L, s.t. ring(L) creates a correct qring
     20// qslimgb(i)             computes a standard basis with slimgb in a qring
     21// hilbRing([i])          create a ring containing the homogenized i
    2122// par2varRing([i])       create a ring with pars to vars together with i
    22 // hilbRing([i])          create a ring containing the homogenized i
    23 // qslimgb(i)             computes a standard basis with slimgb in a qring
     23// quotientList(L,...)    a list, say QL, s.t. ring(QL) creates a correct qring
     24
    2425//////////////////////////////////////////////////////////////////////////////
    2526
    26 proc stdfglm (ideal i, list #)
     27proc stdfglm (i, list #)
    2728"SYNTAX: @code{stdfglm (} ideal_expression @code{)} @*
    2829         @code{stdfglm (} ideal_expression@code{,} string_expression @code{)}
    2930TYPE:    ideal
    3031PURPOSE: computes the standard basis of the ideal in the basering
    31          via @code{fglm} (from the ordering given as the second argument
    32          to the ordering of the basering).@*
    33          If no second argument is given, \"dp\" is used.
    34 SEE ALSO: fglm, groebner, std, stdhilb
     32         via @code{fglm} from the ordering given as the second argument
     33         to the ordering of the basering. If no second argument is given,
     34         \"dp\" is used. The standard basis for the given ordering (resp. for
     35         \"dp\") is computed via the command groebner except if a further
     36         argument \"std\" or \"slimgb\" is given in which case std resp.
     37         slimgb is used.
     38SEE ALSO: fglm, groebner, std, slimgb, stdhilb
    3539KEYWORDS: fglm
    3640EXAMPLE: example stdfglm; shows an example"
    3741{
    38     //### ev. erweitern: Gewichte von aussen setzen
    39     string os;
    40     int s = size(#);
    41     def P= basering;
    42     if( s==0 or (typeof(#[1]) != "string") )
    43     {
    44        os = "dp(" + string( nvars(P) ) + ")";
    45        if ( (find( ordstr(P), os ) != 0) and (find( ordstr(P), "a") == 0) )
    46        {
    47           os= "Dp";
    48        }
    49        else
    50        {
    51           os= "dp";
    52        }
    53     }
    54     else { os = #[1]; }
    55 
    56     list BRlist = ringlist(P);
    57     int nvarP = nvars(P);
    58     intvec w;                       //for ringweights of basering P
    59     int k;
    60     for(k=1;  k<=nvarP; k++)
    61     {
    62        w[k]=deg(var(k));
    63     }
    64 
    65     BRlist[3] = list();
    66     if( s==0 )
    67     {
    68       if( w==1 )
    69       {
    70          BRlist[3][1]=list("dp",w);
     42   if (nrows(i) > 1)
     43   {
     44      ERROR("first argument of 'stdfglm' must be an ideal");
     45   }
     46   string os;
     47   int s = size(#);
     48   def P= basering;
     49   string algorithm;
     50   int ii;
     51   for( ii=1; ii<=s; ii++)
     52   {
     53      if ( typeof(#[ii])== "string" )
     54      {
     55         if ( #[ii]=="std" || #[ii]=="slimgb" )
     56         {
     57            algorithm =  #[ii];
     58            # = delete(#,ii);
     59            s = s-1;
     60            ii--;
     61         }
     62      }
     63   }
     64
     65   if( s > 0 && (typeof(#[1]) == "string") )
     66   {
     67      os = #[1];
     68      ideal Qideal = ideal(P);
     69      int sQ = size(Qideal);
     70      int sM = size(minpoly);
     71      if ( sM!=0 )
     72      {
     73         string mpoly = string(minpoly);
     74      }
     75      if (sQ!=0 )
     76      {
     77        execute("ring Rfglm=("+charstr(P)+"),("+varstr(P)+"),"+os+";");
     78        ideal Qideal = fetch(P,Qideal);
     79        qring Pfglm = groebner(Qideal,"std","slimgb");
    7180      }
    7281      else
    7382      {
    74          BRlist[3][1]=list("wp",w);
    75       }
    76       BRlist[3][2]=list("C",intvec(0));
    77       def Pfglm = ring(quotientList(BRlist));
    78       setring Pfglm;
     83        execute("ring Pfglm=("+charstr(P)+"),("+varstr(P)+"),"+os+";");
     84      }
     85      if ( sM!=0 )
     86      {
     87        execute("minpoly="+mpoly+";");
     88      }
    7989    }
    8090    else
    8191    {
    82        ideal Qideal = ideal(P);
    83        int sQ = size(Qideal);
    84        int sM = size(minpoly);
    85        if ( sM!=0 )
    86        {
    87           string mpoly = string(minpoly);
    88        }
    89        if (sQ!=0 )
    90        {
    91          execute("ring Rfglm=("+charstr(P)+"),("+varstr(P)+"),"+os+";");
    92          ideal Qideal = fetch(P,Qideal);
    93          qring Pfglm = groebner(Qideal,"std","slimgb");
    94        }
    95        else
    96        {
    97           execute("ring Pfglm=("+charstr(P)+"),("+varstr(P)+"),"+os+";");
    98        }
    99        if ( sM!=0 )
    100        {
    101           execute("minpoly="+mpoly+";");
    102        }
    103     }
    104     ideal i= fetch(P,i);
    105 
    106     //save options:
    107     int p_opt;
    108     string s_opt = option();
    109     if (find(s_opt, "prot"))  { p_opt = 1; }
    110     intvec opt= option(get);
    111 
     92      list BRlist = ringlist(P);
     93      int nvarP = nvars(P);
     94      intvec w;                       //for ringweights of basering P
     95      int k;
     96      for(k=1;  k <= nvarP; k++)
     97      {
     98        w[k]=deg(var(k));
     99      }
     100
     101      BRlist[3] = list();
     102      if( s==0 or (typeof(#[1]) != "string") )
     103      {
     104        if( w==1 )
     105        {
     106           BRlist[3][1]=list("dp",w);
     107        }
     108        else
     109        {
     110           BRlist[3][1]=list("wp",w);
     111        }
     112        BRlist[3][2]=list("C",intvec(0));
     113        def Pfglm = ring(quotientList(BRlist));
     114        setring Pfglm;
     115      }
     116    }
     117    ideal i = fetch(P,i);
     118
     119    intvec opt = option(get);            //save options
    112120    option(redSB);
    113     //if(p_opt){"groebner in "+string(Pfglm);}
    114     i = groebner(i,"std","slimgb");
     121    if (size(algorithm) > 0)
     122    {
     123       i = groebner(i,algorithm);
     124    }
     125    else
     126    {
     127       i = groebner(i);
     128    }
    115129    option(set,opt);
    116130    setring P;
     
    119133example
    120134{ "EXAMPLE:"; echo = 2;
    121    ring r=0,(x,y,z),lp;
    122    ideal i=y3+x2,x2y+x2,x3-x2,z4-x2-y;
    123    stdfglm(i);         //uses fglm from "dp" to "lp"
    124 
    125    ring s = (0,x),(y,z,u,v),lp;
    126 // qring qs = std(y2-z3);        ### Bug in fglm mit qring
     135   ring r  = 0,(x,y,z),lp;
     136   ideal i = y3+x2,x2y+x2,x3-x2,z4-x2-y;
     137   stdfglm(i);                   //uses fglm from "dp" (with groebner) to "lp"
     138   stdfglm(i,"std");             //uses fglm from "dp" (with std) to "lp"
     139
     140   ring s  = (0,x),(y,z,u,v),lp;
    127141   minpoly = x2+1;
    128    ideal i = y3+x2,u2y+u2,u3-u2,z4-u2-y,v;
    129    stdfglm(i,"Dp");     //uses fglm from "Dp" to "lp"
     142   ideal i = u5-v4,zv-u2,zu3-v3,z2u-v2,z3-uv,yv-zu,yu-z2,yz-v,y2-u,u-xy2;
     143   weight(i);
     144   stdfglm(i,"(a(2,3,4,5),dp)"); //uses fglm from "(a(2,3,4,5),dp)" to "lp"
    130145}
    131146
    132147/////////////////////////////////////////////////////////////////////////////
    133148
    134 proc stdhilb(ideal i,list #)
     149proc stdhilb(i,list #)
    135150"SYNTAX: @code{stdhilb (} ideal_expression @code{)} @*
     151         @code{stdhilb (} module_expression @code{)} @*
    136152         @code{stdhilb (} ideal_expression@code{,} intvec_expression @code{)}
    137153         @code{stdhilb (} ideal_expression@code{,} list of string_expressions
    138154               and intvec_expressin @code{)} @*
    139 TYPE:    ideal
    140 PURPOSE: Compute a Groebner basis of the ideal in the basering by using the
    141          Hilbert driven Groebner basis algorithm.
     155TYPE:    type of the first argument
     156PURPOSE: Compute a Groebner basis of the ideal/module in the basering by
     157         using the Hilbert driven Groebner basis algorithm.
    142158         If an argument of type string @code{\"std\"} resp. @code{\"slimgb\"}
    143159         is given, the standard basis computation uses @code{std} or
     
    151167         driven algorithm.
    152168NOTE:    'homogeneous' means weighted homogeneous with respect to the weights
    153          w[i] of the variables var(i) of the basering.
    154 ASSUME:  The argument of type intvec is the 1st Hilbert series as computed
    155          by @code{hilb} using an intvector w with w[i]=deg(var(i)).
     169         w[i] of the variables var(i) of the basering. Parameters are not
     170         converted to variables.
     171ASSUME:  The argument of type intvec is the 1st Hilbert series, computed
     172         by @code{hilb} using an intvector w, w[i]=deg(var(i)), as third
     173         argument
    156174SEE ALSO: stdfglm, std, slimgb, groebner
    157175KEYWORDS: Hilbert function
     
    161179//--------------------- save data from basering --------------------------
    162180  def P=basering;
     181  int nr = nrows(i);            //nr=1 iff i is an ideal
    163182  ideal Qideal = ideal(P);      //defining the quotient ideal if P is a qring
    164183  int was_qring;                //remembers if basering was a qring
     
    192211//--------------------- check the given method ---------------------------
    193212  string method;
    194   list Method;
    195213  for (k=1; k<=size(#); k++)
    196214  {
     
    202220     {
    203221       method = method + "," + #[k];
    204        Method = Method + list(#[k]);
    205222     }
    206223  }
     
    225242         return( std(i,hi,w) );
    226243      }
    227       if (p_opt){"stdhilb not implemented, use std in basering";}
    228       //if ( neg ) // std can handle local and mixed orderings
     244      if (p_opt){"//--stdhilb not implemented, use std in basering";}
     245      //if ( neg )
    229246      //{
    230247      //  "//*** WARNING: non-positive ring weights, computation may not finish";
     
    235252//------------------------ change to hilbRing ----------------------------
    236253
    237      list hiRi = hilbRing(i);
    238      intvec W = hiRi[2];
    239      def Philb = hiRi[1];      //note: Philb is no qring and the predefined
    240      setring Philb;            //ideal Id(1) in Philb is homogeneous
    241 
     254     list hiRi = hilbRing(i);  //The ground field of P and Philb coincide
     255     intvec W = hiRi[2];       //Philb has an extra variable @ or @(k)
     256     def Philb = hiRi[1];      //Philb is no qring and the predefined
     257     setring Philb;            //ideal/module Id(1) in Philb is homogeneous
     258                               //Parameters of P are not converted in Philb
    242259//-------- compute Hilbert function of homogenized ideal in Philb ---------
    243260//Philb has only 1 block. There are three cases
     
    266283     if ( algorithm=="slimgb" || ( algorithm=="stdorslimgb" && char(P)==0 ) )
    267284     {
    268        intvec hi = hilb(qslimgb(Id(1)),1,W);
     285        intvec hi = hilb(qslimgb(Id(1)),1,W);
    269286     }
    270287
    271    //------------- case where we need another intermediate ring -------------
    272    //we add extra blocks for homogenizing variable @hilbRing@
    273    //and for converted parameters
     288   //-------------- we need another intermediate ring Phelp ----------------
     289   //In Phelp we change the ordering from Philb, otherwise it coincides with
     290   //Philb, that is, it has in addition to P an extra homogenizing variable
     291   //with name @, resp. @(i) if @ and @(1), ..., @(i-1) are defined.
     292   //Phelp has the same ordering as P on common variables. In Phelp
     293   //a quotient ideal from P is added to the input
    274294
    275295      list BRlist = ringlist(Philb);
     
    297317      def Phelp = ring(quotientList(BRlist));
    298318      setring Phelp;
    299       ideal i = imap(Philb, Id(1));
     319      def i = imap(Philb, Id(1));
    300320      kill Philb;
    301321
    302322      // compute std with Hilbert series
    303       if (w ==1 )
     323      if (w ==1)
    304324      {
    305325         if (p_opt){ "std with hilb in " + string(Phelp);}
     
    320340          "dehomogenization";
    321341      }
    322       i = subst(i, @hilbRing@, 1);
     342      i = subst(i, var(nvars(basering)), 1);
    323343
    324344       if (p_opt)
     
    335355       i = imap(Phelp,i);
    336356       kill Phelp;
     357       if( was_qring)
     358       {
     359         i = NF(i,std(0));
     360       }
    337361       i = simplify(i,34);
    338362
    339        // compute reduces SB
     363       // compute reduced SB
    340364       if (find(s_opt, "redSB") > 0)
    341365       {
    342366         if (p_opt)
    343367         {
    344            "interreduction";
     368           "//interreduction";
    345369         }
    346370         i=interred(i);
     
    392416      }
    393417   }
    394    ideal Qideal  = RL[4];  //##Achtung, nichtkommuatativem Fall behandeln
    395    if( size(Qideal) <= 1)
     418   ideal Qideal  = RL[4];  //##Achtung: falls basering Nullteiler hat, kann
     419                           //die SB eines Elements mehrere Elemente enthalten
     420   if( size(Qideal) <= 0)
    396421   {
    397422      return (RL);
     
    427452///////////////////////////////////////////////////////////////////////////////
    428453proc par2varRing (list #)
    429 "USAGE:   par2varRing([l]); l list of ideals [default:l=empty list]
     454"USAGE:   par2varRing([l]); l list of ideals/modules [default:l=empty list]
    430455RETURN:  list, say L, with L[1] a ring where the parameters of the
    431456         basering have been converted to an additional last block of
    432          variables all of weight 1 and ordering dp.
    433          If a list l with l[i] an ideal is given, then l[i]+minpoly is
    434          mapped to an ideal in L[1] with name Id(i)
     457         variables, all of weight 1, and ordering dp.
     458         If a list l with l[i] an ideal/module is given, then
     459         l[i] + minpoly*freemodule(nrows(l[i])) is mapped to an ideal/module
     460         in L[1] with name Id(i).
    435461         If the basering has no parameters then L[1] is the basering.
    436462EXAMPLE: example par2varRing; shows an example"
     
    445471     for( ii = 1; ii <= s; ii++)
    446472     {
    447         ideal Id(ii) = #[ii];
     473        def Id(ii) = #[ii];
    448474        export (Id(ii));
    449475     }
     
    455481   rlist[1] = parlist[1];
    456482   poly Minpoly = minpoly;     //check for minpoly:
     483   int sm = size(Minpoly);
    457484
    458485   //now create new ring
    459    if ( size(Minpoly) == 0 )
    460    {
    461       for( ii = 1; ii <= s; ii++)
    462       {
    463         ideal Id(ii) = #[ii];
    464       }
    465    }
    466    else
    467    {
    468       if( find(option(),"prot") ){"add minpoly to input";}
    469       for( ii = 1; ii <= s; ii++)
    470       {
    471         ideal Id(ii) = #[ii];
    472         Id(ii)[ncols(Id(ii))+1]=Minpoly;
    473       }
     486   for( ii = 1; ii <= s; ii++)
     487   {
     488      def Id(ii) = #[ii];
    474489   }
    475490   int nvar = size(rlist[2]);
     
    500515   def Ppar2var = ring(quotientList(rlist));
    501516   setring Ppar2var;
    502    for( ii = 1; ii <= s; ii++)
    503    {
    504       def Id(ii) = imap(P,Id(ii));
    505       export (Id(ii));
     517   if ( sm == 0 )
     518   {
     519      for( ii = 1; ii <= s; ii++)
     520      {
     521        def Id(ii) = imap(P,Id(ii));
     522        export (Id(ii));
     523      }
     524   }
     525   else
     526   {
     527      if( find(option(),"prot") ){"//add minpoly to input";}
     528      poly Minpoly = imap(P,Minpoly);
     529      for( ii = 1; ii <= s; ii++)
     530      {
     531        def Id(ii) = imap(P,Id(ii));
     532        Id(ii) = Id(ii),Minpoly*freemodule(nrows(Id(ii)));
     533        export (Id(ii));
     534      }
    506535   }
    507536   list Lpar2var = Ppar2var;
     
    516545   setring(P);
    517546   Id(1);
     547
     548   setring R;
     549   module m = x3*[1,1,1], (xyzuv-1)*[1,0,1];
     550   def Q = par2varRing(m)[1]; Q;
     551   setring(Q);
     552   print(Id(1));
    518553}
    519554
    520555//////////////////////////////////////////////////////////////////////////////
    521556proc hilbRing ( list # )
    522 "USAGE:   hilbRing([l]); l list of ideals [default:l=empty list]
     557"USAGE:   hilbRing([l]); l list of ideals/modules [default:l=empty list]
    523558RETURN:  list, say L: L[1] is a ring and L[2] an intvec
    524          L[1] is a ring whith an extra homogenizing variable
    525          @hilbRing@. The monomial ordering of L[1] is 1 block dp if the
     559         L[1] is a ring whith an extra homogenizing variable with name @,
     560         resp. @(i) if @ and @(1), ..., @(i-1) are defined.
     561         The monomial ordering of L[1] is 1 block dp if the
    526562         weights of the variables of the basering, say R, are all 1, resp.
    527563         wp(w,1) wehre w is the intvec of weights of the variables of R.
    528          If the basering is a quotient ring P/Q, then L[1] is not a quotient
    529          ring but contains the ideal @Qidealhilb@, the homogenized ideal
    530          Q of P.
     564         If R is a quotient ring P/Q, then L[1] is not a quotient ring but
     565         contains the ideal @Qidealhilb@, the homogenized ideal Q of P.
     566         (Parameters of R are not touched).
    531567         If a list l is given with l[i] an ideal, then l[i] is
    532568         mapped to the homogenized ideal Id(i) in L[1].
     
    538574{
    539575   def P = basering;
    540    number Minpoly = minpoly;
    541   //##kann entfallen, wenn minpoly richtig gemapt wird
    542 
    543    if( size(Minpoly) > 0 )     //remember minpoly //##
    544    {
    545      int is_minpoly =1;
    546    }
    547 
    548576   ideal Qideal = ideal(P);    //defining the quotient ideal if P is a qring
    549577   if( size(Qideal) != 0 )
     
    565593   for(k = 1; k <= s; k++)
    566594   {
    567       ideal Id(k) = #[k];
    568    }
    569 
    570     // a homogenizing variable is added
    571     BRlist[2][nvarP+1] = "@hilbRing@";
     595      def Id(k) = #[k];
     596      int nr(k) = nrows(Id(k));
     597   }
     598
     599    // a homogenizing variable is added:
     600    // call it @, resp. @(k) if @(1),...,@(k-1) are defined
     601    string homvar;
     602    if ( defined(@)==0 )
     603    {
     604       homvar = "@";
     605    }
     606    else
     607    {
     608       k=1;
     609       while( defined(@(k)) != 0 )
     610       {
     611          k++;
     612       }
     613       homvar = "@("+string(k)+")";
     614    }
     615    BRlist[2][nvarP+1] = homvar;
    572616    w[nvarP +1]=1;
    573617
     
    588632
    589633    //change ring and get ideal from previous ring
    590     //(imap converts parameters of P automatically to variables in Phelp)
    591     if( defined(is_minpoly) ) //##
    592     {
    593        BRlist[1][4] = ideal(0);
    594     }
    595 
    596634    def Philb = ring(quotientList(BRlist));
    597635    kill BRlist;
    598636    setring Philb;
    599     if( defined(is_minpoly) ) //##
    600     {
    601        minpoly = imap(P,Minpoly);
    602     }
    603637    if( defined(is_qring) )
    604638    {
    605        ideal @Qidealhilb@ =  homog( imap(P,Qideal), @hilbRing@ );
     639       ideal @Qidealhilb@ =  homog( imap(P,Qideal), `homvar` );
    606640       export(@Qidealhilb@);
    607641
     
    609643       for(k = 1; k <= s; k++)
    610644       {  //homogenize
    611           ideal Id(k) =  homog( imap(P,Id(k)), @hilbRing@ ), @Qidealhilb@ ;
     645          def Id(k) =  homog( imap(P,Id(k)), `homvar` );
     646              Id(k) =  Id(k),@Qidealhilb@*freemodule(nr(k)) ;
    612647          export(Id(k));
    613648       }
     
    617652        for(k = 1; k <= s; k++)
    618653        { //homogenize
    619             ideal Id(k) =  homog( imap(P,Id(k)), @hilbRing@ );
     654            def Id(k) =  homog( imap(P,Id(k)), `homvar` );
    620655            export(Id(k));
    621656        }
    622657    }
    623 
    624658    list Lhilb = Philb,w;
    625659    return(Lhilb);
     
    637671   qring T = std(x+y2+z3);
    638672   ideal i = xy+xv+yz+zu+uv,xyzuv-v5;
    639    def Q = hilbRing(i)[1];  Q;
     673   module m = i*[0,1,1] + (xyzuv-v5)*[1,1,0];
     674   def Q = hilbRing(m)[1];  Q;
    640675   setring Q;
    641    Id(1);
     676   print(Id(1));
    642677}
    643678
    644679//////////////////////////////////////////////////////////////////////////////
    645680proc qslimgb (i)
    646 "USAGE:   qslimgb(i); i ideal
    647 RETURN:  ideal, a standard basis of i computed with slimgb
     681"USAGE:   qslimgb(i); i ideal or module
     682RETURN:  same type as input, a standard basis of i computed with slimgb
    648683NOTE:    As long as slimgb does not know qrings qslimgb should be used in case
    649684         the basering is (possibly) a quotient ring. The quotient ideal is
    650685         added to the input and slimgb is applied.
    651          ** not yet implemented for modules
    652686EXAMPLE: example qslimgb; shows an example"
    653687{
     
    676710    kill BRlist;
    677711    setring Phelp;
    678     ideal iq = imap(P,i), imap(P,Qideal);
     712    // module case:
     713    def iq = imap(P,i);
     714    iq = iq, imap(P,Qideal)*freemodule(nrows(iq));
    679715    if (p_opt)
    680716    {
     
    687723    if (p_opt)
    688724    {
    689        "imap to original ring";
     725       "//imap to original ring";
    690726    }
    691727    i = imap(Phelp,iq);
     
    696732       if (p_opt)
    697733       {
    698          "interreduction";
     734         "//interreduction";
    699735       }
    700736       i=interred(i);
     
    708744   qring Q = std(x2-y3);
    709745   ideal i = x+y2,xy+yz+zu+u*v,xyzu*v-1;
    710    ideal j = qslimgb(i);
     746   ideal j = qslimgb(i); j;
     747
     748   module m = [x+y2,1,0], [1,1,x2+y2+xyz];
     749   print(qslimgb(m));
    711750}
    712751
     
    732771           a Groebner basis is first computed with an \"easy\" ordering
    733772           and then converted to the ordering of the basering by the
    734            Hilbert driven Groebner basis computation.
     773           Hilbert driven Groebner basis computation or by linear algebra.
    735774           The actual computation of the Groebner basis can be
    736775           specified by @code{\"std\"} or by @code{\"slimgb\"}
     
    762801//---------------------------------
    763802//0. Immer Aufruf von std unabhaengig von der Vorgabe:
    764 //   gemischte Ordnungen, extra Gewichtsvektor, Matrix Ordnungen, Moduln
     803//   gemischte Ordnungen, extra Gewichtsvektor, Matrix Ordnungen
    765804
    766805//1. Keine Vorgabe: es wirkt die aktuelle Heuristk:
     
    776815//   gewaehlt (da slimgb keine Hilbertfunktion kennt, wird std verwendet).
    777816//   Bei slimgb im qring, wird das Quotientenideal zum Ideal addiert.
    778 //   Bei Angabe von std zusammen mit slimgb (aeuquivalent zur Angabe von
     817//   Bei Angabe von std zusammen mit slimgb (aequivalent zur Angabe von
    779818//   keinem von beidem) wirkt obige Heuristik.
    780819
     
    795834  else {ideal i=i_par; }
    796835  kill i_par;
     836
    797837//----------------------- save the given method ---------------------------
    798838  string method;
     
    803843     if (typeof(#[k]) == "int")
    804844     {
    805        if (defined(wait) != voice)
    806        {
    807          int wait = #[k];
    808        }
     845       int wait = #[k];
    809846     }
    810847     if (typeof(#[k]) == "string")
     
    821858    {
    822859        int j = 10;
    823 
    824860        string bs = nameof(basering);
    825861        link l_fork = "MPtcp:fork";
     
    827863        write(l_fork, quote(system("pid")));
    828864        int pid = read(l_fork);
    829         write(l_fork, quote(groebner(eval(i))));
    830 //###        write(l_fork, quote(groebner(eval(i),Method)));
    831 //Fehlermeldung:
     865//        write(l_fork, quote(groebner(eval(i))));
     866        write(l_fork, quote(groebner(eval(i),eval(Method))));
     867//###Fehlermeldung:
    832868// ***dError: undef. ringorder used
    833869// occured at:
     
    935971    || ( find(ordstr_P,"M") > 0 )
    936972    || ( find(ordstr_P,"a") > 0 )
    937     || ( nrows(i)>1 )    //module case, not yet handled by slimgb
    938     || ( neg>0 ) )       //***fuer Moduln slimgb zulassen, wenn implementiert
     973    || ( neg>0 ) )
    939974  {
    940975    if (p_opt) { "std in basering"; }
    941     //if ( neg > 0 ) // std can handle local and mixed orderings
    942     //{
    943     //  "*** WARNING: some weights are negative, computation may not finish";
    944     //}
    945     i = std(i);
    946     return(i);
     976    return(std(i));
    947977  }
    948978
    949979//now we have:
    950 //ideal, global ordering, no matrix ordering, no extra weight vector
     980//ideal or module, global ordering, no matrix ordering, no extra weight vector
    951981//The interesting cases start now.
    952982
     
    10121042  //define direct:
    10131043  if ( (order=="simple" && (size(method)==0 )) ||
    1014        (order=="simple" && (method==",par2var" && npars_P==0 )) ||
     1044        (order=="simple" && (method==",par2var" && npars_P==0 )) ||
    10151045         (conversion=="no" && partovar=="no" &&
    10161046           (algorithm=="std" || algorithm=="slimgb" ||
     
    10401070     if ( algorithm=="std" || (algorithm=="stdorslimgb" && char(P)>0) )
    10411071     {
    1042        if (p_opt) { "std in " + string(P); }
    1043        return(std(i));
     1072           if (p_opt) { "std in " + string(P); }
     1073           i = std(i);
     1074           return(i);
    10441075     }
    10451076     if ( algorithm=="slimgb" || (algorithm=="stdorslimgb" && char(P)==0) )
    10461077     {
    1047        return(qslimgb(i));
     1078           i = qslimgb(i);
     1079           return(i);
    10481080     }
    10491081  }
     
    10561088//Note thar "par2var" is not a default strategy, it must be explicitely
    10571089//given in order to be performed.
    1058 //## TODO: fglm has still to be implemented
    10591090
    10601091//------------ case where no parameters are made to variables  -------------
     
    10671098     if ( conversion=="fglm" )
    10681099     {
    1069        return (stdfglm(i));
     1100       if ( algorithm=="std" || (algorithm=="stdorslimgb" && char(P)>0) )
     1101       {
     1102         return (stdfglm(i,"std"));
     1103       }
     1104       if ( algorithm=="slimgb" || (algorithm=="stdorslimgb" && char(P)==0) )
     1105       {
     1106         return (stdfglm(i,"slimgb"));
     1107       }
    10701108     }
    1071      if ( algorithm=="std" || (algorithm=="stdorslimgb" && char(P)>0) )
    1072      {
    1073        return (stdhilb(i,"std"));
    1074      }
    1075      if ( algorithm=="slimgb" || (algorithm=="stdorslimgb" && char(P)==0) )
    1076      {
    1077        return (stdhilb(i,"slimgb"));
     1109     else
     1110     {
     1111       if ( algorithm=="std" || (algorithm=="stdorslimgb" && char(P)>0) )
     1112       {
     1113         return (stdhilb(i,"std"));
     1114       }
     1115       if ( algorithm=="slimgb" || (algorithm=="stdorslimgb" && char(P)==0) )
     1116       {
     1117         return (stdhilb(i,"slimgb"));
     1118       }
    10781119     }
    10791120   }
     
    10861127      // reset options
    10871128      option(none);
    1088       // turn on options prot, mem, intStrategy if previously set
     1129      // turn on options prot, mem, redSB, intStrategy if previously set
    10891130      if ( find(s_opt, "prot") )
    10901131      { option(prot); }
    10911132      if ( find(s_opt, "mem") )
    10921133      { option(mem); }
     1134      if ( find(s_opt, "redSB") )
     1135      { option(redSB); }
    10931136      if ( find(s_opt, "intStrategy") )
    10941137      { option(intStrategy); }
     
    11051148      def Phelp = par2varRing(i)[1];   //minpoly is mapped with i
    11061149      setring Phelp;
    1107       ideal i = Id(1);
     1150      def i = Id(1);
    11081151      is_homog = homog(i);
    11091152
     
    11341177       if (p_opt)
    11351178       {
    1136          "simplification";
     1179         "//simplification";
    11371180       }
    11381181
     
    11441187       }
    11451188
    1146        ideal Li = lead(i);
     1189       def Li = lead(i);
    11471190       setring P;
    1148        ideal Li = imap(Phelp,Li);
     1191       def Li = imap(Phelp,Li);
    11491192       Li = simplify(Li,32);
    11501193       intvec vi;
     
    11671210       if (p_opt)
    11681211       {
    1169          "imap to original ring";
     1212         "//imap to original ring";
    11701213       }
    11711214       i = imap(Phelp,i);
     
    11791222         if (p_opt)
    11801223         {
    1181            "interreduction";
     1224           "//interreduction";
    11821225         }
    11831226         i=interred(i);
     
    12051248  groebner(i,"fglm");          //computes a reduced standard basis
    12061249
    1207   if (system("with","MP")) {groebner(i,0);}
     1250  if (system("with","MP")) {groebner(i,10,"std");}
    12081251  defined(Standard::groebner_error);
    12091252  option(set,opt);
     
    20352078
    20362079/*
     2080Versuche:
    20372081///////////////////////////////////////////////////////////////////////////////
    20382082proc downsizeSB (I, list #)
     
    20662110     else
    20672111     {
    2068         ERROR("2nd argument must be an intvec");
     2112        ERROR("// 2nd argument must be an intvec");
    20692113     }
    20702114   }
     
    23012345
    23022346*/
     2347
Note: See TracChangeset for help on using the changeset viewer.