Changeset 6dfc39 in git for factory/facHensel.cc


Ignore:
Timestamp:
Nov 9, 2012, 7:27:54 PM (11 years ago)
Author:
Martin Lee <martinlee84@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '0604212ebb110535022efecad887940825b97c3f')
Children:
b2c7a216311d3bac9e82e892f71b35269aa0886e
Parents:
86faffa8f6328861e386b04ff4aa1238a2145d25
git-author:
Martin Lee <martinlee84@web.de>2012-11-09 19:27:54+01:00
git-committer:
Martin Lee <martinlee84@web.de>2012-11-16 13:19:32+01:00
Message:
fix: bug in diophantineHenselQa
File:
1 edited

Legend:

Unmodified
Added
Removed
  • factory/facHensel.cc

    r86faff r6dfc39  
    535535  Variable beta;
    536536  Off (SW_RATIONAL);
    537   if (mipoHasDen)
    538   {
    539     setReduce (alpha, false);
    540     modMipo= modMipo.mapinto();
    541     modMipo /= lc (modMipo);
    542     beta= rootOf (modMipo);
    543     setReduce (alpha, true);
    544   }
     537  setReduce (alpha, false);
     538  modMipo= modMipo.mapinto();
     539  modMipo /= lc (modMipo);
     540  beta= rootOf (modMipo);
     541  setReduce (alpha, true);
    545542
    546543  setReduce (alpha, false);
    547544  for (k= 0; k < factors.length(); k++)
    548545  {
    549     if (!mipoHasDen)
    550       bufFactors [k]= bufFactors[k].mapinto();
    551     else
    552     {
    553       bufFactors [k]= bufFactors[k].mapinto();
    554       bufFactors [k]= replacevar (bufFactors[k], alpha, beta);
    555     }
     546    bufFactors [k]= bufFactors[k].mapinto();
     547    bufFactors [k]= replacevar (bufFactors[k], alpha, beta);
    556548  }
    557549  setReduce (alpha, true);
     
    596588  recResult= mapinto (recResult);
    597589  setReduce (alpha, true);
    598   if (mipoHasDen)
    599   {
    600     for (CFListIterator i= recResult; i.hasItem(); i++)
    601       i.getItem()= replacevar (i.getItem(), alpha, beta);
    602   }
     590
     591  for (CFListIterator i= recResult; i.hasItem(); i++)
     592    i.getItem()= replacevar (i.getItem(), alpha, beta);
    603593
    604594  setCharacteristic (0);
     
    621611    if (mipoHasDen)
    622612      coeffE= replacevar (coeffE, gamma, beta);
     613    else
     614      coeffE= replacevar (coeffE, alpha, beta);
    623615    setCharacteristic (0);
    624616    if (!coeffE.isZero())
     
    631623      {
    632624        setCharacteristic (p);
    633         setReduce (alpha, false);
    634625        g= mulNTL (coeffE, j.getItem());
    635626        g= modNTL (g, bufFactors[ii]);
    636         setReduce (alpha, true);
    637627        setCharacteristic (0);
    638628        if (mipoHasDen)
     
    641631          k.getItem() += replacevar (g.mapinto()*modulus, beta, gamma);
    642632          e -= mulNTL (replacevar (g.mapinto(), beta, gamma)*modulus,
    643                                    l.getItem(), b);
     633                       l.getItem(), b);
    644634          setReduce (beta, true);
    645635        }
    646636        else
    647637        {
    648           k.getItem() += g.mapinto()*modulus;
    649           e -= mulNTL (g.mapinto()*modulus, l.getItem(), b);
     638          k.getItem() += replacevar (g.mapinto()*modulus, beta, alpha);
     639          e -= mulNTL (replacevar (g.mapinto()*modulus, beta, alpha),
     640                       l.getItem(), b);
    650641        }
    651642        e= b(e);
Note: See TracChangeset for help on using the changeset viewer.