Changeset 6fe9a5 in git for Singular/LIB/bfun.lib


Ignore:
Timestamp:
Mar 18, 2011, 9:12:17 PM (12 years ago)
Author:
Viktor Levandovskyy <levandov@…>
Branches:
(u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
Children:
3542f7c7fb52228c2cae41980c84109e503eaf75
Parents:
19ad27804d6e9c1c16eb3b3f560ad543ea06b922
Message:
*levandov: bugfixes for bfun_lib and dmodapp_lib by Daniel Andres

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

Legend:

Unmodified
Added
Removed
  • Singular/LIB/bfun.lib

    r19ad278 r6fe9a5  
    7575- fixed printlevel/debug message issue in bfct, bfctAnn
    7676- fixed small issue for zero ideal input in linReduceIdeal
     77
     7816.03.11
     79- fixed bug in linReduceIdeal when ideal contained unlucky constellation
     80  of zeros
     81- fixed printlevel/debug message issue in linReduceIdeal
    7782*/
    7883
     
    253258
    254259//-------------- main procedures -------------------------------------------------------
     260
    255261proc linReduceIdeal(ideal I, list #)
    256262"USAGE:  linReduceIdeal(I [,s,t,u]); I an ideal, s,t,u optional ints
     
    301307  int sI = ncols(I);
    302308  int sZeros = sI - size(I);
    303   int i,j;
     309  int i,j,k;
    304310  ideal J,lmJ,ordJ;
    305311  list lJ = sort(I);
     312  intvec iv,iv2; //todo
    306313  module M; // for the coefficients
    307314  // step 1: prepare, e.g. sort I
     
    312319      if (remembercoeffs <> 0)
    313320      {
    314         j = 0;
    315         for (i=1; i<=sI; i++)
    316         {
    317           if (I[i] == 0)
     321        j = 0;
     322        k = 0;
     323        intvec posNonZero;
     324        for (i=1; i<=sI; i++)
     325        {
     326          if (I[i] == 0)
    318327          {
    319328            j++;
     
    322331            M[j] = gen(i);
    323332          }
    324           else
    325           {
    326             M[i+sZeros-j] = gen(lJ[2][i-j]+j);
    327           }
    328         }
     333          else
     334          {
     335            k++;
     336            M[k+sZeros] = gen(lJ[2][k]);
     337            posNonZero = posNonZero,i;
     338          }
     339        }
     340        posNonZero = posNonZero[2..nrows(posNonZero)];
     341        posNonZero = posNonZero[lJ[2]];
     342        for (i=1; i<=size(lJ[1]); i++)
     343        {
     344          M[i+sZeros] = gen(posNonZero[i]);
     345        }
     346        kill posNonZero;
    329347      }
    330348      else
     
    343361      if (remembercoeffs <> 0)
    344362      {
    345         for (i=1; i<=size(lJ[1]); i++) { M[i+sZeros] = gen(lJ[2][i]); }
     363        for (i=1; i<=size(lJ[1]); i++) { M[i] = gen(lJ[2][i]); }
    346364      }
    347365    }
     
    354372    }
    355373  }
    356   dbprint(ppl-1,"// initially sorted ideal:", I);
    357   if (remembercoeffs <> 0) { dbprint(ppl-1,"// used permutations:", M); }
     374  dbprint(ppl,"// initially sorted ideal:", I);
     375  if (remembercoeffs <> 0) { dbprint(ppl,"// used permutations:", M); }
    358376  // step 2: reduce leading monomials by linear reductions
    359377  poly lm,c,redpoly,maxlmJ;
     
    385403          if (lm == lmJ[j])
    386404          {
    387             dbprint(ppl-1,"// reducing " + string(redpoly));
     405            dbprint(ppl-1,"// reducing " + string(redpoly));
    388406            dbprint(ppl-1,"//  with " + string(J[j]));
    389407            c = leadcoef(redpoly)/leadcoef(J[j]);
     
    420438    dbprint(ppl-1,string(J));
    421439    if (remembercoeffs <> 0) { dbprint(ppl-1,"// used reductions:" + string(M)); }
    422     int k;
    423440    for (i=sZeros+1; i<=sI; i++)
    424441    {
Note: See TracChangeset for help on using the changeset viewer.