Changeset 3ea5cee in git for Singular/LIB/presolve.lib


Ignore:
Timestamp:
May 29, 2009, 11:26:48 AM (15 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
a2b50cb2b820afde605ed45cb52930a5913927cc
Parents:
224d153b4a430841dbc33e16788c163dbc00c5ca
Message:
*slaplagne: *bug fixed:
            elimpart was eliminating wrong variables
            when the basering had a matrix ordering.


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

Legend:

Unmodified
Added
Removed
  • Singular/LIB/presolve.lib

    r224d153 r3ea5cee  
    11///////////////////////////////////////////////////////////////////////////////
    2 //changed GMG 20.5.09: degreepart, linearpart, elimpart
    3 ///////////////////////////////////////////////////////////////////////////////
    4 version="$Id: presolve.lib,v 1.33 2009-05-25 09:47:39 Singular Exp $";
     2version="$Id: presolve.lib,v 1.34 2009-05-29 09:26:48 Singular Exp $";
    53category="Symbolic-numerical solving";
    64info="
     
    9492          (default: v = 1,...,1)
    9593         _[2]: remaining generators of id
    96 NOTE:    if id is of type int/number/poly it is converted to ideal, if id is
    97          of type intmat/matrix/vector to module and then the corresponding
    98          generators are computed
    9994EXAMPLE: example degreepart; shows an example
    10095"
     
    149144         _[1]: generators of id of total degree <= 1
    150145         _[2]: remaining generators of id
    151 NOTE:    all variables have degree 1 (independent of ordering of basering)
    152146EXAMPLE: example linearpart; shows an example
    153147"
     
    185179"
    186180{
    187    int ii,n,k,ringchange;
    188    string o;
     181   int ii,n,k;
     182   string o, newo;
    189183   intvec getoption = option(get);
    190184   option(redSB);
     
    200194   if ( n < nvars(BAS) )
    201195   {
    202       rest = maxi[n+1..nvars(BAS)];     //variables which are not substituted
     196      rest = maxi[n+1..nvars(BAS)];
    203197   }
    204198   attrib(rest,"isSB",1);
     
    211205   //## gmg, geŠndert 9/2008: interred sehr lange z.B. bei Leonard1 in normal,
    212206   //daher interred ersetzt durch: std nur auf linearpart angewendet
    213    //Wechsel zu dp Ordnung (da Lin affin linear)
    214 
    215 //--------------- replace ordering different from dp by dp -------------------
    216    o = "dp("+string(n)+")";
    217    if( ! find(ordstr(BAS),o) or find(ordstr(BAS),"a") )
    218    {
    219       ringchange = 1;                         //remember change of ring
     207   //Ordnung muss global sein, sonst egal (da Lin affin linear)
     208
     209//--------------- replace ordering by dp if it is not global -----------------
     210   if ( ord_test(BAS) <= 0 )
     211   {
    220212      intvec V;
    221213      V[n]=0; V=V+1;                          //weights for dp ordering
     
    238230      lin = lin,id1;
    239231      lin = std(lin);
    240       id = simplify(NF(id,lin),2);   //instead of subst, (### is faster)
     232      id = simplify(NF(id,lin),2);   //instead of subst
    241233      id1 = linearpart(id)[1];
    242234   }
     
    283275//------------------ go back to original ring end return  ---------------------
    284276
    285    if ( ringchange  )                   //i.e there was a ring change
     277   if ( ord_test(BAS) <= 0  )           //i.e there was a ring change
    286278   {
    287279      setring BAS;
     
    355347
    356348   list L = elimlinearpart(i,n);
     349   if ( e == 0 )
     350   {
     351       return(L);
     352   }
    357353   ideal lin, eva, sub, neva, phi = L[1], L[2], L[3], L[4], L[5];
    358    if ( e == 0 )
    359    {
    360        return(L);
    361    }
    362 
    363354//-------- direct substitution of variables if possible and if e!=0 -----------
    364355// first find terms lin1 in lin of pure degree 1 in each polynomial of lin
     
    391382-z ergibt ich auch i[2]-z*i[3] mit option(redThrough)
    392383statt interred kann man hier auch NF(i,i[3])+i[3] verwenden
    393 hier lifert elimpart(i) 2 Substitutionen (x,y) elimpart(interred(i))
     384hier liefert elimpart(i) 2 Substitutionen (x,y) elimpart(interred(i))
    394385aber 3 (x,y,z)
    395386Da interred oder NF aber die Laenge der polys vergroessern kann, nicht gemacht
     
    430421   //kin = polys of lin which contained a pure degree 1 part.
    431422   kin = simplify(kin,2);
    432    l = size(kin);                      //l != 0 since lin1 != 0
     423   l = ncols(kin);                    //l != 0 since lin1 != 0
    433424   poly p,kip,vip, cand;
    434425   int count=1;
     
    441432            {
    442433               p = kin[kk]/var(ii);
    443                //if ( deg(p) == 0 )
    444                //old test, does not work if some var has deg 0
    445                //geaendert Mai 09 gmg
    446 
    447                if( p!=0 & p == jet(p,0) )
    448                    //this means that kin[kk]= p*var(ii) + h,
    449                    //with p=const !=0 and h not depending on var(ii)
     434               if ( deg(p) == 0 )  //this means that kin[kk]= p*var(ii) + h,
     435                                   //with p=const and h not depending on var(ii)
    450436               {
    451437                  //we look for the shortest candidate to substitute var(ii)
     
    462448                  }
    463449                }
    464             }
     450            }     
    465451            if ( cand != 0 )
    466452            {
    467453                  p = cand/var(ii);
    468                   kip = cand/p;     //normalized polynomial of kin w.r.t var(ii)
     454                  kip = cand/p;      //normalized polynomial of kin w.r.t var(ii)
    469455                  eva = eva+var(ii); //var(ii) added to list of elimin. vars
    470456                  neva[ii] = 0;
Note: See TracChangeset for help on using the changeset viewer.