Changeset 31b296e in git


Ignore:
Timestamp:
Jul 25, 2019, 3:18:50 PM (4 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', '828514cf6e480e4bafc26df99217bf2a1ed1ef45')
Children:
bd5ff4034c6329566588caf816d298e914084631
Parents:
35a153cf7acb82519d52d0b74581e9a193d15765
Message:
opt: less calls to setCharacteristic(p),pLength in conv. Singular->Factory
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpolys/polys/clapconv.cc

    r35a153 r31b296e  
    8787  p1=p;
    8888  l=l/2;
    89   while(l>0) { p=pNext(p); l--; }
     89  while(l>1) { p=pNext(p); l--; }
    9090  p2=pNext(p);
    9191  pNext(p)=NULL;
     
    101101
    102102#define MIN_CONV_LEN 7
    103 CanonicalForm convSingPFactoryP( poly p, const ring r )
     103static CanonicalForm convSingPFactoryP_intern( poly p, int l, BOOLEAN & setChar,const ring r )
    104104{
    105105  CanonicalForm result = 0;
    106106  int e, n = rVar(r);
    107   BOOLEAN setChar=TRUE;
    108 
    109   int l;
    110   if ((l=pLength(p))>MIN_CONV_LEN)
     107  assume(l==pLength(p));
     108
     109  if (l>MIN_CONV_LEN)
    111110  {
    112111    poly p1,p2;
    113112    convPhalf(p,l,p1,p2);
    114     CanonicalForm P=convSingPFactoryP(p1,r);
    115     P+=convSingPFactoryP(p2,r);
     113    CanonicalForm P=convSingPFactoryP_intern(p1,l/2,setChar,r);
     114    P+=convSingPFactoryP_intern(p2,l-l/2,setChar,r);
    116115    convPunhalf(p1,p2);
    117116    return P;
    118117  }
     118  BOOLEAN setChar_loc=setChar;
     119  setChar=FALSE;
    119120  while ( p!=NULL )
    120121  {
    121     CanonicalForm term=r->cf->convSingNFactoryN(pGetCoeff( p ),setChar, r->cf);
     122    CanonicalForm term=r->cf->convSingNFactoryN(pGetCoeff( p ),setChar_loc, r->cf);
    122123    if (errorreported) break;
    123     setChar=FALSE;
     124    setChar_loc=FALSE;
    124125    for ( int i = 1; i <=n; i++ )
    125126    {
     
    131132 }
    132133 return result;
     134}
     135
     136CanonicalForm convSingPFactoryP( poly p, const ring r )
     137{
     138  BOOLEAN setChar=TRUE;
     139  return convSingPFactoryP_intern(p,pLength(p),setChar,r);
    133140}
    134141
Note: See TracChangeset for help on using the changeset viewer.