Changeset ad0177 in git for factory/facFqBivar.cc


Ignore:
Timestamp:
Mar 6, 2012, 9:48:34 PM (12 years ago)
Author:
Martin Lee <martinlee84@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
24c6177e872b135f0188fea998eb45a75e3fde6e
Parents:
54af8a51cc8091a4687fb55bf401e31a0478bc1e
git-author:
Martin Lee <martinlee84@web.de>2012-03-06 21:48:34+01:00
git-committer:
Martin Lee <martinlee84@web.de>2012-04-04 14:42:27+02:00
Message:
chg: use uniFdivides in factorRecombination
chg: take care of GF in uniFdivides and univariate *,/,%
chg: switch on SW_RATIONAL if necessary
File:
1 edited

Legend:

Unmodified
Added
Removed
  • factory/facFqBivar.cc

    r54af8a5 rad0177  
    4343TIMING_DEFINE_PRINT(fac_hensel_lift12)
    4444
    45 CanonicalForm prodMod0 (const CFList& L, const CanonicalForm& M)
     45CanonicalForm prodMod0 (const CFList& L, const CanonicalForm& M, const modpk& b)
    4646{
    4747  if (L.isEmpty())
     
    5050    return mod (L.getFirst()(0, 1) , M);
    5151  else if (L.length() == 2)
    52     return mod (mulNTL (L.getFirst()(0, 1),L.getLast()(0, 1)), M);
     52    return mod (mulNTL (L.getFirst()(0, 1),L.getLast()(0, 1), b), M);
    5353  else
    5454  {
     
    6060      tmp1.append (i.getItem());
    6161    tmp2= Difference (L, tmp1);
    62     buf1= prodMod0 (tmp1, M);
    63     buf2= prodMod0 (tmp2, M);
    64     return mod (mulNTL (buf1,buf2), M);
     62    buf1= prodMod0 (tmp1, M, b);
     63    buf2= prodMod0 (tmp2, M, b);
     64    return mod (mulNTL (buf1,buf2, b), M);
    6565  }
    6666}
     
    487487  bool recombination= false;
    488488  CanonicalForm test;
    489   CanonicalForm buf0= buf (0, x)*LCBuf;
     489  CanonicalForm buf0= mulNTL (buf (0, x), LCBuf, b);
     490  bool isRat= (isOn (SW_RATIONAL) && getCharacteristic() == 0) || getCharacteristic() > 0;
    490491  while (T.length() >= 2*s && s <= thres)
    491492  {
     
    521522      else
    522523      {
    523         test= prodMod0 (S, M);
    524         test *= LCBuf;
    525         test = mod (test, M);
    526         if (b.getp() != 0)
    527           test= b(test);
    528         if (fdivides (test, buf0))
     524        test= prodMod0 (S, M, b);
     525        test= mulNTL (test, LCBuf, b);
     526        test= mod (test, M);
     527        if (uniFdivides (test, buf0))
    529528        {
    530529          S.insert (LCBuf);
     
    534533            g= b(g);
    535534          g /= content (g, x);
     535          if (!isRat)
     536            On (SW_RATIONAL);
    536537          if (fdivides (g, buf, quot))
    537538          {
     
    543544            l -= degree (g);
    544545            M= power (y, l);
    545             buf0= buf (0, x)*LCBuf;
     546            if (!isRat)
     547              Off (SW_RATIONAL);
     548            buf0= mulNTL (buf (0, x), LCBuf, b);
    546549            // compute new possible degree pattern
    547550            bufDegs2= DegreePattern (T);
     
    569572            if (nosubset) break;
    570573          }
     574          if (!isRat)
     575            Off (SW_RATIONAL);
    571576        }
    572577      }
     
    661666  CanonicalForm buf1= mulNTL (buf (1,x), LCBuf, b);
    662667  CanonicalForm test0, test1;
     668  bool isRat= (isOn (SW_RATIONAL) && getCharacteristic() == 0) || getCharacteristic() > 0;
    663669  for (CFListIterator i= factors; i.hasItem(); i++, l++)
    664670  {
     
    677683            g= b(g);
    678684          g /= content (g, x);
     685          if (!isRat)
     686            On (SW_RATIONAL);
    679687          if (fdivides (g, buf, quot))
    680688          {
     
    684692            d -= degree (g);
    685693            LCBuf= LC (buf, x);
     694            if (!isRat)
     695              Off (SW_RATIONAL);
    686696            buf0= mulNTL (buf (0,x), LCBuf, b);
    687697            buf1= mulNTL (buf (1,x), LCBuf, b);
     
    699709            }
    700710          }
     711          if (!isRat)
     712            Off (SW_RATIONAL);
    701713        }
    702714      }
Note: See TracChangeset for help on using the changeset viewer.