Changeset e23e9c in git for factory/facHensel.cc


Ignore:
Timestamp:
Nov 27, 2012, 10:30:22 AM (11 years ago)
Author:
Martin Lee <martinlee84@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '0604212ebb110535022efecad887940825b97c3f')
Children:
c9733f738bb04e006afa1dbf956d830e0689e758
Parents:
96d505212a6d61ec4e31fe4f7c2e2044f89eb69e
git-author:
Martin Lee <martinlee84@web.de>2012-11-27 10:30:22+01:00
git-committer:
Martin Lee <martinlee84@web.de>2012-11-27 11:17:53+01:00
Message:
chg: speed up of diophantineHensel and diophantineHenselQa
File:
1 edited

Legend:

Unmodified
Added
Removed
  • factory/facHensel.cc

    r96d5052 re23e9c  
    450450  CanonicalForm modulus= p;
    451451  int d= b.getk();
     452  modpk b2;
    452453  for (int i= 1; i < d; i++)
    453454  {
     
    456457    coeffE= coeffE.mapinto();
    457458    setCharacteristic (0);
     459    b2= modpk (p, d - i);
    458460    if (!coeffE.isZero())
    459461    {
     
    465467      {
    466468        setCharacteristic (p);
    467         g= mulNTL (coeffE, j.getItem());
     469        g= modNTL (coeffE, bufFactors[ii]);
     470        g= mulNTL (g, j.getItem());
    468471        g= modNTL (g, bufFactors[ii]);
    469472        setCharacteristic (0);
    470473        k.getItem() += g.mapinto()*modulus;
    471         e -= mulNTL (g.mapinto()*modulus, l.getItem(), b);
     474        e -= mulNTL (g.mapinto(), b2 (l.getItem()), b2)*modulus;
    472475        e= b(e);
    473476      }
     
    629632  CanonicalForm modulus= p;
    630633  int d= b.getk();
     634  modpk b2;
    631635  for (int i= 1; i < d; i++)
    632636  {
     
    647651      coeffE= replacevar (coeffE, alpha, beta);
    648652    setCharacteristic (0);
     653    b2= modpk (p, d - i);
    649654    if (!coeffE.isZero())
    650655    {
     
    656661      {
    657662        setCharacteristic (p);
    658         g= mulNTL (coeffE, j.getItem());
     663        g= modNTL (coeffE, bufFactors[ii]);
     664        g= mulNTL (g, j.getItem());
    659665        g= modNTL (g, bufFactors[ii]);
    660666        setCharacteristic (0);
     
    663669          setReduce (beta, false);
    664670          k.getItem() += replacevar (g.mapinto()*modulus, beta, gamma);
    665           e -= mulNTL (replacevar (g.mapinto(), beta, gamma)*modulus,
    666                        l.getItem(), b);
     671          e -= mulNTL (replacevar (g.mapinto(), beta, gamma),
     672                       b2 (l.getItem()), b2)*modulus;
    667673          setReduce (beta, true);
    668674        }
    669675        else
    670676        {
     677          setReduce (beta, false);
    671678          k.getItem() += replacevar (g.mapinto()*modulus, beta, alpha);
    672           e -= mulNTL (replacevar (g.mapinto()*modulus, beta, alpha),
    673                        l.getItem(), b);
     679          e -= mulNTL (replacevar (g.mapinto(), beta, alpha),
     680                       b2 (l.getItem()), b2)*modulus;
     681          setReduce (beta, true);
    674682        }
    675683        e= b(e);
Note: See TracChangeset for help on using the changeset viewer.