Changeset 28500c in git for Singular/LIB/normal.lib


Ignore:
Timestamp:
Jul 27, 1998, 11:13:02 AM (26 years ago)
Author:
Olaf Bachmann <obachman@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
d8cc2a7cea0a2cbf24ab556a355de8a20e298df6
Parents:
ae35b679235b164e70dad2c057963595f25bdd23
Message:
* incoporated Gerhard's bug fixes


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

Legend:

Unmodified
Added
Removed
  • Singular/LIB/normal.lib

    rae35b67 r28500c  
    66///////////////////////////////////////////////////////////////////////////////
    77
    8 version="$Id: normal.lib,v 1.7 1998-06-17 09:23:17 pfister Exp $";
     8version="$Id: normal.lib,v 1.8 1998-07-27 09:13:02 obachman Exp $";
    99info="
    1010LIBRARY: normal.lib: PROCEDURE FOR NORMALIZATION (I)
     
    254254      ideal endphi = maxideal(1);
    255255      ideal endid = fetch(P,id);
     256      L=substpart(endid,endphi,homo,rw);
     257      def lastRing=L[1];
     258      setring lastRing;
     259
    256260      attrib(endid,"isCohenMacaulay",isCo);
    257261      attrib(endid,"isPrim",isPr);
     
    261265      attrib(endid,"isCompleteIntersection",0);
    262266      attrib(endid,"isRad",0);
    263       export endid;
    264       export endphi;
    265       L = newR1;
     267//      export endid;
     268//      export endphi;
     269//      L = newR1;
     270      L=lastRing;
    266271      L = insert(L,1,1);
    267272      dbprint(printlevel-voice+3,"// case R = Hom(J,J)");
     
    270275         "R=Hom(rad(J),rad(J))";
    271276         "   ";
    272          newR1;
     277         lastRing;
    273278         "   ";
    274279         "the new ideal";
     
    284289         id;
    285290         "   ";
    286          setring newR1;
     291         setring lastRing;
    287292         "the map";
    288293         "   ";
     
    385390   ideal endphi = ideal(X(1..nvars(R)));
    386391
    387    map phi = basering,maxideal(1);
    388    list Le = elimpart(endid);
    389            //this proc and the next loop try to
    390    q = size(Le[2]);                 //substitute as many variables as possible
    391    rw1 = 0;
    392    rw1[nvars(basering)] = 0;
    393    rw1 = rw1+1;
    394 
    395    while( size(Le[2]) != 0 )
    396    {
    397       endid = Le[1];
    398       map ps = newRing,Le[5];
    399       phi = phi(ps);
    400       kill ps;
    401 
    402       for( ii=1; ii<=size(rw1); ii++ )
    403       {
    404          if( Le[4][ii]==0 )
    405          {
    406             rw1[ii]=0;                             //look for substituted vars
    407          }
    408       }
    409       Le=elimpart(endid);
    410       q = q + size(Le[2]);
    411    }
    412    endphi = phi(endphi);
    413 
    414 //---------- return -----------------------------------------------------------
    415 // in the homogeneous case put weights for the remaining vars correctly, i.e.
    416 // delete from rw those weights for which the corresponding entry of rw1 is 0
    417 
    418    if (homo==1 && nvars(newRing)-q >1 && size(endid) >0 )
    419    {
    420       jj=1;
    421       for( ii=2; ii<size(rw1); ii++)
    422       {
    423          jj++;
    424          if( rw1[ii]==0 )
    425          {
    426             rw=rw[1..jj-1],rw[jj+1..size(rw)];
    427             jj=jj-1;
    428          }
    429       }
    430       if( rw1[1]==0 ) { rw=rw[2..size(rw)]; }
    431       if( rw1[size(rw1)]==0 ){ rw=rw[1..size(rw)-1]; }
    432 
    433       ring lastRing = char(R),(T(1..nvars(newRing)-q)),(a(rw),dp);
    434    }
    435    else
    436    {
    437       ring lastRing = char(R),(T(1..nvars(newRing)-q)),dp;
    438    }
    439 
    440    ideal lastmap;
    441    q = 1;
    442    for(ii=1; ii<=size(rw1); ii++ )
    443    {
    444       if ( rw1[ii]==1 ) { lastmap[ii] = T(q); q=q+1; }
    445       if ( rw1[ii]==0 ) { lastmap[ii] = 0; }
    446    }
    447    map phi = newRing,lastmap;
    448    ideal endid  = phi(endid);
    449    ideal endphi = phi(endphi);
     392   L=substpart(endid,endphi,homo,rw);
     393   def lastRing=L[1];
     394   setring lastRing;
    450395   attrib(endid,"isCohenMacaulay",isCo);
    451396   attrib(endid,"isPrim",isPr);
     
    455400   attrib(endid,"isCompleteIntersection",0);
    456401   attrib(endid,"isRad",0);
    457   export(endid);
    458   export(endphi);
    459    if(y==1)
     402  // export(endid);
     403  // export(endphi);
     404           if(y==1)
    460405   {
    461406      "the new ring after reduction of the number of variables";
     
    652597example
    653598{ "EXAMPLE:"; echo = 2;
    654  //Theo1
    655  ring r=32003,(x,y,z),wp(2,3,6);
    656  ideal i=zy2-zx3-x6;
    657 
    658  list pr=normal(i);
    659  def r1=pr[1];
    660  setring r1;
    661  KK;
    662  setring r;
     599   ring  r = 0,(x,y,z),dp;
     600
    663601}
    664602
     
    690628   int depth,lauf,prdim;
    691629   int ti=timer;
    692 
     630   
    693631   if(size(i)==0)
    694632   {
     
    794732         }
    795733         MB=SM[2];
    796          execute "ring newR6="+charstr(basering)+",("+varstr(basering)+"),("
    797                       +ordstr(basering)+");";
    798          ideal KK=fetch(BAS,MB);
    799          ideal PP=fetch(BAS,ihp);
     734         intvec rw;
     735         list LL=substpart(MB,ihp,0,rw);
     736         def newR6=LL[1];
     737         setring newR6;
     738         ideal KK=endid;
     739         ideal PP=endphi;
     740//        execute "ring newR6="+charstr(basering)+",("+varstr(basering)+"),("
     741//                      +ordstr(basering)+");";
     742//         ideal KK=fetch(BAS,MB);
     743//         ideal PP=fetch(BAS,ihp);
    800744         export PP;
    801745         export KK;
     
    814758      }
    815759      MB=maxideal(1);
    816       execute "ring newR5="+charstr(basering)+",("+varstr(basering)+"),("
    817                       +ordstr(basering)+");";
    818       ideal KK=fetch(BAS,MB);
    819       ideal PP=fetch(BAS,ihp);
     760      intvec rw;
     761      list LL=substpart(MB,ihp,0,rw);
     762      def newR5=LL[1];
     763      setring newR5;
     764      ideal KK=endid;
     765      ideal PP=endphi;
     766//      execute "ring newR5="+charstr(basering)+",("+varstr(basering)+"),("
     767//                      +ordstr(basering)+");";
     768//      ideal KK=fetch(BAS,MB);
     769//      ideal PP=fetch(BAS,ihp);
    820770      export PP;
    821771      export KK;
     
    836786      }
    837787      MB=SM[2];
    838       execute "ring newR4="+charstr(basering)+",("+varstr(basering)+"),("
    839                       +ordstr(basering)+");";
    840       ideal KK=fetch(BAS,MB);
    841       ideal PP=fetch(BAS,ihp);
     788      intvec rw;
     789      list LL=substpart(MB,ihp,0,rw);
     790      def newR4=LL[1];
     791      setring newR4;
     792      ideal KK=endid;
     793      ideal PP=endphi;
     794//      execute "ring newR4="+charstr(basering)+",("+varstr(basering)+"),("
     795//                      +ordstr(basering)+");";
     796//      ideal KK=fetch(BAS,MB);
     797//      ideal PP=fetch(BAS,ihp);
    842798      export PP;
    843799      export KK;
     
    916872         }
    917873         MB=SM[2];
    918          execute "ring newR3="+charstr(basering)+",("+varstr(basering)+"),("
    919                       +ordstr(basering)+");";
    920          ideal KK=fetch(BAS,MB);
    921          ideal PP=fetch(BAS,ihp);
     874         intvec rw;
     875         list LL=substpart(MB,ihp,0,rw);
     876//         execute "ring newR3="+charstr(basering)+",("+varstr(basering)+"),("
     877//                      +ordstr(basering)+");";
     878         def newR3=LL[1];
     879         setring newR3;
     880//         ideal KK=fetch(BAS,MB);
     881//         ideal PP=fetch(BAS,ihp);
     882         ideal KK=endid;
     883         ideal PP=endphi;
    922884         export PP;
    923885         export KK;
     
    11501112         setring lastR;
    11511113         ideal KK=endid;
    1152          ideal PP=fetch(BAS,ihp);
     1114         ideal PP=endphi;
    11531115         export PP;
    11541116         export KK;
     
    12321194example
    12331195{ "EXAMPLE:";echo = 2;
    1234 //Theo1
    1235 ring r=32003,(x,y,z),wp(2,3,6);
    1236 ideal i=zy2-zx3-x6;
     1196   LIB"normal.lib";
     1197   //Huneke
     1198ring qr=31991,(a,b,c,d,e),dp;
     1199ideal i=
     12005abcde-a5-b5-c5-d5-e5,
     1201ab3c+bc3d+a3be+cd3e+ade3,
     1202a2bc2+b2cd2+a2d2e+ab2e2+c2de2,
     1203abc5-b4c2d-2a2b2cde+ac3d2e-a4de2+bcd2e3+abe5,
     1204ab2c4-b5cd-a2b3de+2abc2d2e+ad4e2-a2bce3-cde5,
     1205a3b2cd-bc2d4+ab2c3e-b5de-d6e+3abcd2e2-a2be4-de6,
     1206a4b2c-abc2d3-ab5e-b3c2de-ad5e+2a2bcde2+cd2e4,
     1207b6c+bc6+a2b4e-3ab2c2de+c4d2e-a3cde2-abd3e2+bce5;
    12371208
    12381209list pr=normal(i);
     
    12401211setring r1;
    12411212KK;
    1242 setring r;
    12431213}
    12441214
     1215proc substpart(ideal endid,ideal endphi, int homo, intvec rw)
     1216{
     1217   def newRing=basering;
     1218   int ii,jj;
     1219   map phi = basering,maxideal(1);
     1220   list Le = elimpart(endid);
     1221           //this proc and the next loop try to
     1222   int q = size(Le[2]);              //substitute as many variables as possible
     1223   intvec rw1 = 0;                   //indices of substituted variables
     1224   rw1[nvars(basering)] = 0;
     1225   rw1 = rw1+1;
     1226
     1227   while( size(Le[2]) != 0 )
     1228   {
     1229      endid = Le[1];
     1230      map ps = newRing,Le[5];
     1231      phi = ps(phi);
     1232      kill ps;
     1233
     1234      for( ii=1; ii<=size(rw1); ii++ )
     1235      {
     1236         if( Le[4][ii]==0 )
     1237         {
     1238            rw1[ii]=0;                             //look for substituted vars
     1239         }
     1240      }
     1241      Le=elimpart(endid);
     1242      q = q + size(Le[2]);
     1243   }
     1244   endphi = phi(endphi);
     1245
     1246//---------- return -----------------------------------------------------------
     1247// in the homogeneous case put weights for the remaining vars correctly, i.e.
     1248// delete from rw those weights for which the corresponding entry of rw1 is 0
     1249
     1250   if (homo==1 && nvars(newRing)-q >1 && size(endid) >0 )
     1251   {
     1252      jj=1;
     1253      for( ii=2; ii<size(rw1); ii++)
     1254      {
     1255         jj++;
     1256         if( rw1[ii]==0 )
     1257         {
     1258            rw=rw[1..jj-1],rw[jj+1..size(rw)];
     1259            jj=jj-1;
     1260         }
     1261      }
     1262      if( rw1[1]==0 ) { rw=rw[2..size(rw)]; }
     1263      if( rw1[size(rw1)]==0 ){ rw=rw[1..size(rw)-1]; }
     1264
     1265      ring lastRing = char(basering),(T(1..nvars(newRing)-q)),(a(rw),dp);
     1266   }
     1267   else
     1268   {
     1269      ring lastRing = char(basering),(T(1..nvars(newRing)-q)),dp;
     1270   }
     1271
     1272   ideal lastmap;
     1273   q = 1;
     1274   for(ii=1; ii<=size(rw1); ii++ )
     1275   {
     1276      if ( rw1[ii]==1 ) { lastmap[ii] = T(q); q=q+1; }
     1277      if ( rw1[ii]==0 ) { lastmap[ii] = 0; }
     1278   }
     1279   map phi = newRing,lastmap;
     1280   ideal endid  = phi(endid);
     1281   ideal endphi = phi(endphi);
     1282   export(endid);
     1283   export(endphi);
     1284   list L = lastRing;
     1285   setring newRing;
     1286   return(L);
     1287}
    12451288
    12461289
Note: See TracChangeset for help on using the changeset viewer.