Changeset 9614bb in git


Ignore:
Timestamp:
Mar 13, 2013, 4:19:09 PM (10 years ago)
Author:
Martin Lee <martinlee84@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '5a0dde71de01068fad5736a17555c993ecbbf495')
Children:
4dafdf52cf2d705ceadc92ee5814b9066fee4125
Parents:
a601d5555bc411c2f00957c8f324951e8d88085f
git-author:
Martin Lee <martinlee84@web.de>2013-03-13 16:19:09+01:00
git-committer:
Martin Lee <martinlee84@web.de>2013-03-22 15:51:38+01:00
Message:
chg: some optimizations to computation of logarithmic derivatives
File:
1 edited

Legend:

Unmodified
Added
Removed
  • factory/facFqBivarUtil.cc

    ra601d5 r9614bb  
    454454  logDeriv= mulMod2 (q, deriv (G, y), xToL);
    455455
    456   logDeriv= swapvar (logDeriv, x, y);
    457   int j= degree (logDeriv) + 1;
     456  int j= degree (logDeriv, y) + 1;
    458457  CFArray result= CFArray (j);
     458  CFIterator ii;
    459459  for (CFIterator i= logDeriv; i.hasTerms() && !logDeriv.isZero(); i++)
    460460  {
    461     if (i.exp() == j - 1)
    462     {
    463       result [j - 1]= swapvar (i.coeff(), x, y);
    464       j--;
    465     }
    466     else
    467     {
    468       for (; i.exp() < j - 1; j--)
    469         result [j - 1]= 0;
    470       result [j - 1]= swapvar (i.coeff(), x, y);
    471       j--;
    472     }
    473   }
    474   for (; j > 0; j--)
    475     result [j - 1]= 0;
     461    for (ii= i.coeff(); ii.hasTerms(); ii++)
     462      result[ii.exp()] += ii.coeff()*power (x,i.exp());
     463  }
    476464  Q= q;
    477465  return result;
     
    533521  logDeriv= mulMod2 (q, deriv (G, y), xToL);
    534522
    535   logDeriv= swapvar (logDeriv, x, y);
    536   int j= degree (logDeriv) + 1;
     523  int j= degree (logDeriv,y) + 1;
    537524  CFArray result= CFArray (j);
     525  CFIterator ii;
    538526  for (CFIterator i= logDeriv; i.hasTerms() && !logDeriv.isZero(); i++)
    539527  {
    540     if (i.exp() == j - 1)
    541     {
    542       result [j - 1]= swapvar (i.coeff(), x, y);
    543       j--;
    544     }
    545     else
    546     {
    547       for (; i.exp() < j - 1; j--)
    548         result [j - 1]= 0;
    549       result [j - 1]= swapvar (i.coeff(), x, y);
    550       j--;
    551     }
    552   }
    553   for (; j > 0; j--)
    554     result [j - 1]= 0;
     528    for (ii= i.coeff(); ii.hasTerms(); ii++)
     529      result[ii.exp()] += ii.coeff()*power (x,i.exp());
     530  }
    555531  Q= q;
    556532  return result;
Note: See TracChangeset for help on using the changeset viewer.