Changeset de222e in git for factory


Ignore:
Timestamp:
Feb 16, 2012, 3:54:42 PM (12 years ago)
Author:
Martin Lee <martinlee84@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
eb481bfd5b0d2091758933b4dc457ec82ff37ce7
Parents:
d9357b93f2957d0cd01e1c353822adb5598cc142
git-author:
Martin Lee <martinlee84@web.de>2012-02-16 15:54:42+01:00
git-committer:
Martin Lee <martinlee84@web.de>2012-04-04 14:42:25+02:00
Message:
chg: cheaper divisibility tests to discard wrong factors
File:
1 edited

Legend:

Unmodified
Added
Removed
  • factory/facFqBivar.cc

    rd9357b rde222e  
    652652  adaptedLiftBound= 0;
    653653  int d= degree (F), l= 0;
     654  CanonicalForm buf0= mulNTL (buf (0,x), LCBuf, b);
     655  CanonicalForm buf1= mulNTL (buf (1,x), LCBuf, b);
     656  CanonicalForm test0, test1;
    654657  for (CFListIterator i= factors; i.hasItem(); i++, l++)
    655658  {
     
    658661    else
    659662    {
    660       g= mulMod2 (i.getItem(), LCBuf, M);
    661       g /= content (g, x);
    662       if (fdivides (g, buf, quot))
    663       {
    664         reconstructedFactors.append (g);
    665         factorsFoundIndex[l]= 1;
    666         buf= quot;
    667         d -= degree (g);
    668         LCBuf= LC (buf, x);
    669         T= Difference (T, CFList (i.getItem()));
    670         F= buf;
    671 
    672         // compute new possible degree pattern
    673         bufDegs2= DegreePattern (T);
    674         bufDegs1.intersect (bufDegs2);
    675         bufDegs1.refine ();
    676         if (bufDegs1.getLength() <= 1)
    677         {
    678           reconstructedFactors.append (buf);
    679           break;
     663      test1= mod (mulNTL (i.getItem() (1,x), LCBuf, b), M);
     664      if (uniFdivides (test1, buf1))
     665      {
     666        test0= mod (mulNTL (i.getItem() (0,x), LCBuf, b), M);
     667        if (uniFdivides (test0, buf0))
     668        {
     669          g= mulMod2 (i.getItem(), LCBuf, M);
     670          if (b.getp() != 0)
     671            g= b(g);
     672          g /= content (g, x);
     673          if (fdivides (g, buf, quot))
     674          {
     675            reconstructedFactors.append (g);
     676            factorsFoundIndex[l]= 1;
     677            buf= quot;
     678            d -= degree (g);
     679            LCBuf= LC (buf, x);
     680            buf0= mulNTL (buf (0,x), LCBuf, b);
     681            buf1= mulNTL (buf (1,x), LCBuf, b);
     682            T= Difference (T, CFList (i.getItem()));
     683            F= buf;
     684
     685            // compute new possible degree pattern
     686            bufDegs2= DegreePattern (T);
     687            bufDegs1.intersect (bufDegs2);
     688            bufDegs1.refine ();
     689            if (bufDegs1.getLength() <= 1)
     690            {
     691              reconstructedFactors.append (buf);
     692              break;
     693            }
     694          }
    680695        }
    681696      }
Note: See TracChangeset for help on using the changeset viewer.