Changeset faed79 in git for Singular/LIB/presolve.lib


Ignore:
Timestamp:
Feb 20, 2009, 10:26:50 AM (15 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', '17f1d200f27c5bd38f5dfc6e8a0879242279d1d8')
Children:
67555dbff0c54631269c2ede478103e9cd2cc3cf
Parents:
9b4893753f061124557a6f764b1588a09516031e
Message:
*gmg: new versions for normal.lib


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

Legend:

Unmodified
Added
Removed
  • Singular/LIB/presolve.lib

    r9b4893 rfaed79  
    1 //last change: 13.02.2001 (Eric Westenberger)
    2 ///////////////////////////////////////////////////////////////////////////////
    3 version="$Id: presolve.lib,v 1.27 2006-12-18 18:37:04 Singular Exp $";
     1///////////////////////////////////////////////////////////////////////////////
     2version="$Id: presolve.lib,v 1.28 2009-02-20 09:26:50 Singular Exp $";
    43category="Symbolic-numerical solving";
    54info="
     
    87
    98PROCEDURES:
    10  degreepart(id,d1,d2);  elements of id of total degree >= d1 and <= d2
     9 degreepart(id,d1,d2);  elements of id of total degree >= d1 and <= d2, and rest
    1110 elimlinearpart(id);    linear part eliminated from id
    1211 elimpart(id[,n]);      partial elimination of vars [among first n vars]
     
    1817 tolessvars(id[,]);     maps id to new basering having only vars occuring in id
    1918 solvelinearpart(id);   reduced std-basis of linear part of id
    20  sortandmap(id[..]);   map to new basering with vars sorted w.r.t. complexity
     19 sortandmap(id[..]);    map to new basering with vars sorted w.r.t. complexity
    2120 sortvars(id[n1,p1..]); sort vars w.r.t. complexity in id [different blocks]
    2221 valvars(id[..]);       valuation of vars w.r.t. to their complexity in id
     
    8988proc degreepart (id,int d1,int d2,list #)
    9089"USAGE:   degreepart(id,d1,d2[,v]);  id=ideal/module, d1,d1=integers, v=intvec
    91 RETURN:  generators of id of [v-weighted] total degree >= d1 and <= d2
    92          (default: v = 1,...,1)
     90RETURN:  list of size 2,
     91         _[1]: generators of id of [v-weighted] total degree >= d1 and <= d2
     92          (default: v = 1,...,1)
     93         _[2]: remaining generators of id
    9394EXAMPLE: example degreepart; shows an example
    9495"
    9596{
    96    def dpart = id;
    97    int s,ii = size(id),0;
     97   if( typeof(id)=="int" or typeof(id)=="number" or typeof(id)=="ideal" )
     98   {
     99      ideal dpart = ideal(id);
     100   }
     101   if( typeof(id)=="intmat" or typeof(id)=="matrix" or typeof(id)=="module")
     102   {
     103      module dpart = module(id);
     104   }
     105
     106   def epart = dpart;
     107   int s,ii = ncols(id),0;
    98108   if ( size(#)==0 )
    99109   {
     110      for ( ii=1; ii<=s; ii++ )
     111      {
     112         dpart[ii] = (jet(id[ii],d1-1)==0)*(id[ii]==jet(id[ii],d2))*id[ii];
     113         epart[ii] = (size(dpart[ii])==0) * id[ii];
     114      }
     115   }
     116   else
     117   {
    100118      for ( ii=1; ii<=s; ii=ii+1 )
    101119      {
    102          dpart[ii] = (jet(id[ii],d1-1)==0)*(id[ii]==jet(id[ii],d2))*id[ii];
    103       }
    104    }
    105    else
    106    {
    107       for ( ii=1; ii<=s; ii=ii+1 )
    108       {
    109          dpart[ii]=(jet(id[ii],d1-1,#[1])==0)*(id[ii]==jet(id[ii],d2,#[1]))*id[ii];
    110       }
    111    }
    112    return(simplify(dpart,2));
     120      dpart[ii]=(jet(id[ii],d1-1,#[1])==0)*(id[ii]==jet(id[ii],d2,#[1]))*id[ii];
     121       epart[ii] = (size(dpart[ii])==0)*id[ii];
     122      }
     123   }
     124   list L = simplify(dpart,2),simplify(epart,2);
     125   return(L);
    113126}
    114127example
     
    117130   ideal i=1+x+x2+x3+x4,3,xz+y3+z8;
    118131   degreepart(i,0,4);
     132
    119133   module m=[x,y,z],x*[x3,y2,z],[1,x2,z3,0,1];
    120134   intvec v=2,3,6;
    121135   show(degreepart(m,8,8,v));
     136}
     137///////////////////////////////////////////////////////////////////////////////
     138
     139proc linearpart (id)
     140"USAGE:   linearpart(id);  id=ideal/module
     141RETURN:  list of size 2,
     142         _[1]: generators of id of total degree <= 1
     143         _[2]: remaining generators of id
     144EXAMPLE: example linearpart; shows an example
     145"
     146{
     147   return(degreepart(id,0,1));
     148}
     149example
     150{ "EXAMPLE:"; echo = 2;
     151   ring r=0,(x,y,z),dp;
     152   ideal i=1+x+x2+x3,3,x+3y+5z;
     153   linearpart(i);
     154
     155   module m=[x,y,z],x*[x3,y2,z],[1,x2,z3,0,1];
     156   show(linearpart(m));
    122157}
    123158///////////////////////////////////////////////////////////////////////////////
     
    128163RETURN:   list L with 5 entries:
    129164  @format
    130   L[1]: (interreduced) ideal obtained from i by substituing
    131         from the first n variables those, which appear in a linear part
    132         of i, by putting this part into triangular form
     165  L[1]: ideal obtained from i by substituting from the first n variables those
     166        which appear in a linear part of i, by putting this part into triangular
     167        form
    133168  L[2]: ideal of variables which have been substituted
    134169  L[3]: ideal, j-th element defines substitution of j-th var in [2]
     
    137172        L[1] is the image of i
    138173  @end format
    139 NOTE:    the procedure does always interreduce the ideal i internally w.r.t.
     174NOTE:    the procedure always interreduces the ideal i internally w.r.t.
    140175         ordering dp.
    141176EXAMPLE: example elimlinearpart; shows an example
    142177"
    143178{
    144    int ii,n,fi,k;
     179   int ii,n,k;
    145180   string o, newo;
    146181   intvec getoption = option(get);
    147182   option(redSB);
    148    def P = basering;
    149    n = nvars(P);
    150 //--------------- replace ordering by dp-ordering if necessary ----------------
    151    o = "dp("+string(n)+")";
    152    fi = find(ordstr(P),o);
    153    if( fi == 0 or find(ordstr(P),"a") != 0 )
    154    {
    155       execute("ring newP = ("+charstr(P)+"),("+varstr(P)+"),dp;");
    156       ideal i = imap(P,i);
    157    }
     183   def BAS = basering;
     184   n = nvars(BAS);
     185   list gnirlist = ringlist(basering);
     186   list g3 = gnirlist[3];
     187   list g32 = g3[size(g3)];
     188
    158189//---------------------------------- start ------------------------------------
    159190   if ( size(#)!=0 ) {  n=#[1]; }
    160191   ideal maxi,rest = maxideal(1),0;
    161    if ( n < nvars(P) ) { rest = maxi[n+1..nvars(P)]; }
     192   if ( n < nvars(BAS) )
     193   {
     194      rest = maxi[n+1..nvars(BAS)];
     195   }
    162196   attrib(rest,"isSB",1);
    163 //-------------------- interreduce and find linear part  ----------------------
    164 // interred does the only real work. Because of ordering dp the linear part is
    165 // within the first elements after interreduction
    166 // **: perhaps Bareiss to constant matrix of linear part instead of interred,
    167 // and/or for big systems, interred only those generators of id
     197
     198//-------------------- find linear part and reduce rest ----------------------
     199// Perhaps for big systems, check only those generators of id
    168200// which do not contain elements not to be eliminated
    169201
    170    ideal id = interred(i);
    171 
    172    if(id[1] == 1 )                          //special case of unit ideal
    173    {
    174      setring P;
     202   //ideal id = interred(i);
     203   //## gmg, geŠndert 9/2008: interred sehr lange z.B. bei Leonard1 in normal,
     204   //daher interred ersetzt durch: std nur auf linearpart angewendet
     205   //Ordnung muss global sein, sonst egal (da Lin affin linear)
     206
     207//--------------- replace ordering by dp if it is not global -----------------
     208   if ( ord_test(BAS) <= 0 )
     209   {
     210      intvec V; 
     211      V[n]=0; V=V+1;                          //weights for dp ordering
     212      gnirlist[3] = list("dp",V), g32;
     213      def newBAS = ring(gnirlist);            //change of ring to dp ordering
     214      setring newBAS;
     215      ideal i = imap(BAS,i);
     216   }
     217     
     218   list  Lin = linearpart(i);
     219   ideal lin = std(Lin[1]);          //SB of ideal generated by polys of i
     220                                     //having at most degree 1
     221   ideal id = Lin[2];                //remaining polys from i, of deg > 1
     222   id = simplify(NF(id,lin),2);      //instead of subst
     223   ideal id1 = linearpart(id)[1];
     224   while( size(id1) != 0 )           //repeat to find linear parts
     225   {
     226      lin = lin,id1;
     227      lin = std(lin);
     228      id = simplify(NF(id,lin),2);   //instead of subst
     229      id1 = linearpart(id)[1];
     230   }
     231//------------- check for special case of unit ideal and return ---------------
     232   int check;
     233   if( lin[1] == 1 )
     234   {
     235     check = 1;
     236   }
     237   else             
     238   {
     239     for (ii=1; ii<=size(id); ii++ )
     240     {
     241       if ( id[ii] == 1 )
     242       {
     243         check = 1; break;
     244        }
     245      }
     246    }
     247
     248   if (check == 1)        //case of a unit ideal
     249   {
     250     setring BAS;
    175251     list L = ideal(1), ideal(0), ideal(0), maxideal(1), maxideal(1);
    176252     option(set,getoption);
    177253     return(L);
    178254   }
    179 
    180    for ( ii=1; ii<=size(id); ii++ )
    181    {
    182       if( deg(id[ii]) > 1) { break; }
    183       k=ii;
    184    }
    185    if( k == 0 )       { ideal lin; }
    186    else               { ideal lin = id[1..k];}
    187    if( k < size(id) ) { id = id[k+1..size(id)]; }
    188    else               { id = 0; }
    189255//----- remove generators from lin containing vars not to be eliminated  ------
    190    if ( n < nvars(P) )
     256   if ( n < nvars(BAS) )
    191257   {
    192258      for ( ii=1; ii<=size(lin); ii++ )
     
    199265      }
    200266   }
    201    lin = simplify(lin,3);
    202    attrib(lin,"isSB",1);
    203    ideal eva = lead(lin);
     267   lin = simplify(lin,1);
     268   ideal eva = lead(lin);               //vars to be eliminated
    204269   attrib(eva,"isSB",1);
    205    ideal neva = reduce(maxideal(1),eva);
     270   ideal neva = NF(maxideal(1),eva);    //vars not to be eliminated
    206271//------------------ go back to original ring end return  ---------------------
    207    if( fi == 0 or find(ordstr(P),"a") != 0 )
    208    {
    209       setring P;
    210       ideal id = imap(newP,id);
    211       ideal eva = imap(newP,eva);
    212       ideal lin = imap(newP,lin);
    213       ideal neva = imap(newP,neva);
     272
     273   if ( ord_test(BAS) <= 0  )           //i.e there was a ring change
     274   {
     275      setring BAS;
     276      ideal id = imap(newBAS,id);
     277      ideal eva = imap(newBAS,eva);
     278      ideal lin = imap(newBAS,lin);
     279      ideal neva = imap(newBAS,neva);
    214280   }
    215281
    216282   eva = eva[ncols(eva)..1];  // sorting according to variables in basering
    217283   lin = lin[ncols(lin)..1];
    218    ideal phi= neva;
     284   ideal phi = neva;
    219285   k = 1;
    220286   for( ii=1; ii<=n; ii++ )
     
    226292      }
    227293   }
     294
    228295   list L = id, eva, lin, neva, phi;
    229296   option(set,getoption);
     
    232299example
    233300{ "EXAMPLE:"; echo = 2;
    234    ring s=0,(x,y,z),dp;
    235    ideal i = x3+y2+z,x2y2+z3,y+z+1;
    236   elimlinearpart(i);
    237 }
    238 ///////////////////////////////////////////////////////////////////////////////
    239 
     301   ring s=0,(u,x,y,z),dp;
     302   ideal i = u3+y3+z-x,x2y2+z3,y+z+1,y+u;
     303   elimlinearpart(i);
     304}
     305///////////////////////////////////////////////////////////////////////////////
    240306proc elimpart (ideal i,list #)
    241307"USAGE:   elimpart(i [,n,e] );  i=ideal, n,e=integers
     
    260326            k[x(1..m)]/i -> k[..variables from [4]..]/[1]
    261327  @end format
    262 NOTE:    If the basering has ordering (c,dp), this is faster for big ideals,
    263          since it avoids internal ring change and mapping.
     328NOTE:    Applying elimpart to interred(i) may result in more sbstitutions.
     329         However, interred may be more expansive than elimpart for big ideals
    264330EXAMPLE: example elimpart; shows an example
    265331"
    266332{
    267    def P = basering;
    268    int n,e = nvars(P),1;
     333   def BAS = basering;
     334   int n,e = nvars(BAS),1;
    269335   if ( size(#)==1 ) {  n=#[1]; }
    270336   if ( size(#)==2 ) {  n=#[1]; e=#[2];}
    271337//----------- interreduce linear part with proc elimlinearpart ----------------
    272 // lin = ideal after interreduction of linear part
     338// lin = ideal i after interreduction with linear part
    273339// eva = eliminated (substituted) variables
    274340// sub = polynomials defining substitution
    275341// neva= not eliminated variables
    276342// phi = map describing substitution
     343
    277344   list L = elimlinearpart(i,n);
    278345   ideal lin, eva, sub, neva, phi = L[1], L[2], L[3], L[4], L[5];
     346   if ( e == 0 )
     347   {
     348       return(L);
     349   }
    279350//-------- direct substitution of variables if possible and if e!=0 -----------
    280 // first find terms lin1 of pure degree 1 in each poly of lin
    281 // k1 = pure degree 1 part, k1+k2 = those polys of lin which contained a pure
     351// first find terms lin1 in lin of pure degree 1 in each poly of lin
     352// k1 = pure degree 1 part, i.e. nonzero elts of lin1, renumbered
     353// k2 = lin2 (=matrix(lin) - matrix(lin2)), renumbered
     354// kin = matrix(k1)+matrix(k2) = those polys of lin which contained a pure
    282355// degree 1 part.
    283 // Then go to ring newP with ordering c,dp(n) and create a matrix with size(k1)
    284 // colums and 2 rows, such that if [f1,f2] is a column of M then f1+f2 is one
    285 // of the polys of lin containing a pure degree 1 part and f1 is this part
    286 // interreduce this matrix (i.e. Gauss elimination on linear part, with rest
    287 // transformed accordingly).
     356/*
     357Alte Version mit interred:
     358// Then go to ring newBAS with ordering c,dp(n) and create a matrix with
     359// size(k1) colums and 2 rows, such that if [f1,f2] is a column of M then f1+f2
     360// is one of the polys of lin containing a pure degree 1 part and f1 is this
     361// part interreduce this matrix (i.e. Gauss elimination on linear part, with
     362// rest transformed accordingly).
     363//Ist jetzt durch direkte Substitution gemacht (schneller!)
     364         //Variante falls wieder interred angewendet werden soll:
     365         //ideal k12 = k1,k2;
     366         //matrix M = matrix(k12,2,kk);     //degree 1 part is now in row 1
     367         //M = interred(M);             
     368         //### interred zu teuer, muss nicht sein. Wenn interred angewendet 
     369         //werden soll, vorher in Ring mit Ordnung (c,dp) wechseln!
     370         //Abfrage:  if( ordstr(BAS) != "c,dp("+string(n)+")" )
     371         //auf KEINEN Fall std (wird zu gross)
     372         //l = ncols(M);
     373         //k1 = M[1,1..l];
     374         //k2 = M[2,1..l];
     375Interred ist jetzt ganz weggelassen. Aber es gibt Beispiele wo interred polys
     376mit Grad 1 Teilen produziert, die vorher nicht da waren (aus polys, die einen konstanten Term haben).
     377z.B. i=xy2-xu4-x+y2,x2y2+z3+zy,y+z2+1,y+u2;, interred(i)=z2+y+1,y2-x,u2+y,x3-z
     378-z ergibt ich auch i[2]-z*i[3] mit option(redThrough)
     379statt interred kann man hier auch NF(i,i[3])+i[3] verwenden
     380hier lifert elimpart(i) 2 Substitutionen (x,y) elimpart(interred(i))
     381aber 3 (x,y,z)
     382Da interred oder NF aber die Laenge der polys vergroessern kann, nicht gemacht
     383*/
    288384   int ii, kk;
    289    if ( e!=0 )
    290    {
    291       ideal k1,k2;
    292       int l = size(lin);
    293       ideal lin1 = jet(lin,1) - jet(lin,0);  // part of pure degree 1
    294       lin = lin - lin1;                      // rest, part of degree 1 substracted
    295 
    296       for( ii=1; ii<=l; ii++ )
    297       {
    298          if( lin1[ii] != 0 )
    299          {
    300             kk = kk+1;
    301             k1[kk] = lin1[ii];    // part of pure degree 1, renumbered
    302             k2[kk] = lin[ii];     // rest of those polys which had a degree 1 part
    303             lin[ii] = 0;
    304          }
    305       }
    306 
    307       if( kk != 0 )
    308       {
    309          if( ordstr(P) != "c,dp(n)" )
    310          {
    311             execute("ring newP = ("+charstr(P)+"),("+varstr(P)+"),(c,dp);");
    312             ideal k1 = imap(P,k1);
    313             ideal k2 = imap(P,k2);
    314             ideal lin = imap(P,lin);
    315             ideal eva = imap(P,eva);
    316             ideal sub = imap(P,sub);
    317             ideal neva = imap(P,neva);
    318          }
    319          ideal k12 = k1,k2;
    320          matrix M = matrix(k12,2,kk);
    321         // M = interred(M);
    322          l = ncols(M);
    323          k1 = M[1,1..l];
    324          k2 = M[2,1..l];
    325          ideal kin = matrix(k1)+matrix(k2);
    326          lin = simplify(lin,2);
    327 
    328          l = size(kin);
    329          poly p; map phi; ideal max;
    330          for ( ii=1; ii<=n; ii++  )
     385   ideal k1, k2, lin2;
     386   int l = size(lin);                   // lin=i after applying elimlinearpart
     387   ideal lin1 = jet(lin,1)-jet(lin,0);  // part of pure degree 1
     388   //Note: If i,i1,i2 are ideals, then i = i1 - i2 is equivalent to
     389   //i = ideal(matrix(i1) - matrix(i2))
     390
     391   if (size(lin1) == 0 )
     392   {
     393       return(L);
     394   }
     395
     396   //-------- check candidates for direct substitution of variables ----------
     397   //since lin1 != 0 there are candidates for substituting variables
     398
     399   lin2 = lin - lin1;      //difference as matrix       
     400   // rest of lin, part of pure degree 1 substracted from each generator of lin
     401
     402   for( ii=1; ii<=l; ii++ )
     403   {
     404      if( lin1[ii] != 0 )
     405      {
     406         kk = kk+1;
     407         k1[kk] = lin1[ii];  // part of pure degree 1, renumbered
     408         k2[kk] = lin2[ii];  // rest of those polys which had a degree 1 part
     409         lin2[ii] = 0;
     410      }
     411   }
     412   //Now each !=0 generator of lin2 contains only constant terms or terms of
     413   //degree >= 2, hence lin 2 can never be used for further substitutions
     414   //We have: lin = ideal(matrix(k1)+matrix(k2)), lin2
     415
     416   ideal kin = matrix(k1)+matrix(k2);
     417   //kin = polys of lin which contained a pure degree 1 part.
     418   kin = simplify(kin,2);
     419   l = size(kin);                      //l != 0 since lin1 != 0
     420   poly p,kip,vip, cand;
     421   int count=1;
     422   while ( count != 0 )
     423   {   
     424         count = 0;
     425         for ( ii=1; ii<=n; ii++  )    //start direct substitution of var(ii)
    331426         {
    332427            for (kk=1; kk<=l; kk++ )
    333428            {
    334429               p = kin[kk]/var(ii);
    335                if ( deg(p) == 0 )
     430               if ( deg(p) == 0 )  //this means that kin[kk]= p*var(ii) + h,
     431                                   //with p=const and h not depending on var(ii)
    336432               {
    337                   eva = eva+var(ii);
     433                  //we look for the shortest candidate to substitute var(ii)
     434                  if ( cand == 0 )
     435                  {
     436                     cand = kin[kk];  //candidate for substituting var(ii)
     437                  }
     438                  else
     439                  {
     440                     if ( size(kin[kk]) < size(cand) )
     441                     {
     442                        cand = kin[kk];
     443                     }
     444                  }
     445                }
     446            }                     
     447            if ( cand != 0 )
     448            {
     449                  p = cand/var(ii);
     450                  kip = cand/p;      //normalized poly of kin w.r.t var(ii)
     451                  eva = eva+var(ii); //var(ii) added to list of elimin. vars
    338452                  neva[ii] = 0;
    339                   sub = sub+kin[kk]/p;
    340                   max = maxideal(1);
    341                   max[ii] = var(ii) - (kin[kk]/p);
    342                   phi = basering,max;
    343                   lin = phi(lin);
    344                   kin = simplify(phi(kin),2);
     453                  sub = sub+kip;     //poly defining substituion
     454                  //## gmg: geŠndert 08/2008, map durch subst ersetzt
     455                  //(viel schneller)
     456                  vip = var(ii) - kip;  //poly to be substituted
     457                  lin = subst(lin, var(ii), vip);  //subst in rest
     458                  lin = simplify(lin,2);
     459                  kin = subst(kin, var(ii), vip);  //subst in pure dgree 1 part
     460                  kin = simplify(kin,2);
    345461                  l = size(kin);
    346                  // ii=ii+1;
    347                   break;
    348                }
     462                  count = 1;
    349463            }
     464            cand=0;
    350465         }
    351          lin = kin+lin;
    352       }
    353    }
     466   }
     467         
     468   lin = kin+lin;
     469 
    354470   for( ii=1; ii<=size(lin); ii++ )
    355471   {
    356472      lin[ii] = cleardenom(lin[ii]);
    357473   }
    358    if( defined(newP) )
    359    {
    360       setring P;
    361       lin = imap(newP,lin);
    362       eva = imap(newP,eva);
    363       sub = imap(newP,sub);
    364       neva = imap(newP,neva);
    365    }
    366    for( ii=1; ii<=n; ii++ )
     474
     475   for( ii=1; ii<=n; ii++ )     
    367476   {
    368477      for( kk=1; kk<=size(eva); kk++ )
     
    372481      }
    373482   }
    374    map psi=P,phi;
    375    ideal phi1=maxideal(1);
    376    for(ii=1;ii<=size(eva);ii++){phi1=psi(phi1);}
     483   map psi = BAS,phi;
     484   ideal phi1 = maxideal(1);
     485   for(ii=1; ii<=size(eva); ii++)
     486   {
     487      phi1=psi(phi1);
     488   }
    377489   L = lin, eva, sub, neva, phi1;
    378   return(L);
    379 }
    380 example
    381 { "EXAMPLE:"; echo = 2;
    382    ring s=0,(x,y,z),dp;
    383    ideal i =x2+y2,x2+y+1;
    384    elimpart(i,3,0);
    385    elimpart(i,3,1);
     490   return(L);
     491}
     492example
     493{ "EXAMPLE:"; echo = 2;
     494   ring s=0,(u,x,y,z),dp;
     495   ideal i = xy2-xu4-x+y2,x2y2+z3+zy,y+z2+1,y+u2;
     496   elimpart(i);
     497
     498   i = interred(i); i;
     499   elimpart(i);
     500
     501   elimpart(i,2);
    386502}
    387503
     
    785901///////////////////////////////////////////////////////////////////////////////
    786902
    787 proc linearpart (id)
    788 "USAGE:   linearpart(id);  id=ideal/module
    789 RETURN:  generators of id of total degree <= 1
    790 EXAMPLE: example linearpart; shows an example
    791 "
    792 {
    793    return(degreepart(id,0,1));
    794 }
    795 example
    796 { "EXAMPLE:"; echo = 2;
    797    ring r=0,(x,y,z),dp;
    798    ideal i=1+x+x2+x3,3,x+3y+5z;
    799    linearpart(i);
    800    module m=[x,y,z],x*[x3,y2,z],[1,x2,z3,0,1];
    801    show(linearpart(m));
    802 }
    803 ///////////////////////////////////////////////////////////////////////////////
    804 
    805903proc tolessvars (id ,list #)
    806904"USAGE:   tolessvars(id [,s1,s2] ); id poly/ideal/vector/module/matrix,
     
    889987      if(#[1]!=0) { option(noredSB); }
    890988   }
    891    def lin = interred(degreepart(id,0,1));
     989   def lin = interred(degreepart(id,0,1)[1]);
    892990   if ( size(#)!=0 )
    893991   {
Note: See TracChangeset for help on using the changeset viewer.