Changeset bbb3fbf in git


Ignore:
Timestamp:
Feb 8, 2012, 12:31:23 PM (12 years ago)
Author:
Martin Lee <martinlee84@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
be5dffcd4f610fc562096a62c16ab61c1e5c0ab0
Parents:
fdae2dc8d40153cbd857c71de2961e22d3f0a252
git-author:
Martin Lee <martinlee84@web.de>2012-02-08 12:31:23+01:00
git-committer:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2012-02-10 14:16:44+01:00
Message:
chg: use NTL multiplication in prodMod0
chg: use a cheap test to discard wrong combinations during
     factor recombination
File:
1 edited

Legend:

Unmodified
Added
Removed
  • factory/facFqBivar.cc

    rfdae2d rbbb3fbf  
    5050    return mod (L.getFirst()(0, 1) , M);
    5151  else if (L.length() == 2)
    52     return mod (L.getFirst()(0, 1)*L.getLast()(0, 1), M);
     52    return mod (mulNTL (L.getFirst()(0, 1),L.getLast()(0, 1)), M);
    5353  else
    5454  {
     
    6262    buf1= prodMod0 (tmp1, M);
    6363    buf2= prodMod0 (tmp2, M);
    64     return mod (buf1*buf2, M);
     64    return mod (mulNTL (buf1,buf2), M);
    6565  }
    6666}
     
    295295  bool recombination= false;
    296296  bool trueFactor= false;
     297  CanonicalForm test;
     298  CanonicalForm buf0= buf (0, x)*LCBuf;
    297299  while (T.length() >= 2*s && s <= thres)
    298300  {
     
    329331      else
    330332      {
    331         S.insert (LCBuf);
    332         g= prodMod (S, M);
    333         S.removeFirst();
    334         g /= content (g, x);
    335         if (fdivides (g, buf, quot))
    336         {
    337           buf2= g (y - eval, y);
    338           buf2 /= Lc (buf2);
    339 
    340           if (!k && beta.level() == 1)
     333        test= prodMod0 (S, M);
     334        test *= LCBuf;
     335        test = mod (test, M);
     336        if (fdivides (test, buf0))
     337        {
     338          S.insert (LCBuf);
     339          g= prodMod (S, M);
     340          S.removeFirst();
     341          g /= content (g, x);
     342          if (fdivides (g, buf, quot))
    341343          {
    342             if (degree (buf2, alpha) < degMipoBeta)
     344            buf2= g (y - eval, y);
     345            buf2 /= Lc (buf2);
     346
     347            if (!k && beta.level() == 1)
    343348            {
    344               buf= quot;
    345               LCBuf= LC (buf, x);
    346               recombination= true;
    347               appendTestMapDown (result, buf2, info, source, dest);
    348               trueFactor= true;
    349             }
    350           }
    351           else
    352           {
    353             if (!isInExtension (buf2, gamma, k, delta, source, dest))
    354             {
    355               buf= quot;
    356               LCBuf= LC (buf, x);
    357               recombination= true;
    358               appendTestMapDown (result, buf2, info, source, dest);
    359               trueFactor= true;
    360             }
    361           }
    362           if (trueFactor)
    363           {
    364             T= Difference (T, S);
    365             l -= degree (g);
    366             M= power (y, l);
    367 
    368             // compute new possible degree pattern
    369             bufDegs2= DegreePattern (T);
    370             bufDegs1.intersect (bufDegs2);
    371             bufDegs1.refine ();
    372             if (T.length() < 2*s || T.length() == s ||
    373                 bufDegs1.getLength() == 1)
    374             {
    375               delete [] v;
    376               if (recombination)
     349              if (degree (buf2, alpha) < degMipoBeta)
    377350              {
    378                 appendTestMapDown (result, buf (y - eval, y), info, source,
    379                                     dest);
    380                 F= 1;
    381                 return result;
    382               }
    383               else
    384               {
    385                 appendMapDown (result, F (y - eval, y), info, source, dest);
    386                 F= 1;
    387                 return result;
     351                buf= quot;
     352                LCBuf= LC (buf, x);
     353                recombination= true;
     354                appendTestMapDown (result, buf2, info, source, dest);
     355                trueFactor= true;
    388356              }
    389357            }
    390             trueFactor= false;
    391             TT= copy (T);
    392             indexUpdate (v, s, T.length(), nosubset);
    393             if (nosubset) break;
     358            else
     359            {
     360              if (!isInExtension (buf2, gamma, k, delta, source, dest))
     361              {
     362                buf= quot;
     363                LCBuf= LC (buf, x);
     364                recombination= true;
     365                appendTestMapDown (result, buf2, info, source, dest);
     366                trueFactor= true;
     367              }
     368            }
     369            if (trueFactor)
     370            {
     371              T= Difference (T, S);
     372              l -= degree (g);
     373              M= power (y, l);
     374              buf0= buf (0, x)*LCBuf;
     375
     376              // compute new possible degree pattern
     377              bufDegs2= DegreePattern (T);
     378              bufDegs1.intersect (bufDegs2);
     379              bufDegs1.refine ();
     380              if (T.length() < 2*s || T.length() == s ||
     381                  bufDegs1.getLength() == 1)
     382              {
     383                delete [] v;
     384                if (recombination)
     385                {
     386                  appendTestMapDown (result, buf (y - eval, y), info, source,
     387                                      dest);
     388                  F= 1;
     389                  return result;
     390                }
     391                else
     392                {
     393                  appendMapDown (result, F (y - eval, y), info, source, dest);
     394                  F= 1;
     395                  return result;
     396                }
     397              }
     398              trueFactor= false;
     399              TT= copy (T);
     400              indexUpdate (v, s, T.length(), nosubset);
     401              if (nosubset) break;
     402            }
    394403          }
    395404        }
     
    477486  TT= copy (factors);
    478487  bool recombination= false;
     488  CanonicalForm test;
     489  CanonicalForm buf0= buf (0, x)*LCBuf;
    479490  while (T.length() >= 2*s && s <= thres)
    480491  {
     
    508519      else
    509520      {
    510         S.insert (LCBuf);
    511         g= prodMod (S, M);
    512         S.removeFirst();
    513         g /= content (g, x);
    514 
    515         if (fdivides (g, buf, quot))
    516         {
    517           recombination= true;
    518           result.append (g);
    519           buf= quot;
    520           LCBuf= LC (buf, x);
    521           T= Difference (T, S);
    522           l -= degree (g);
    523           M= power (y, l);
    524 
    525           // compute new possible degree pattern
    526           bufDegs2= DegreePattern (T);
    527           bufDegs1.intersect (bufDegs2);
    528           bufDegs1.refine ();
    529           if (T.length() < 2*s || T.length() == s ||
    530               bufDegs1.getLength() == 1)
     521        test= prodMod0 (S, M);
     522        test *= LCBuf;
     523        test = mod (test, M);
     524        if (fdivides (test, buf0))
     525        {
     526          S.insert (LCBuf);
     527          g= prodMod (S, M);
     528          S.removeFirst();
     529          g /= content (g, x);
     530          if (fdivides (g, buf, quot))
    531531          {
    532             delete [] v;
    533             if (recombination)
     532            recombination= true;
     533            result.append (g);
     534            buf= quot;
     535            LCBuf= LC (buf, x);
     536            T= Difference (T, S);
     537            l -= degree (g);
     538            M= power (y, l);
     539            buf0= buf (0, x)*LCBuf;
     540            // compute new possible degree pattern
     541            bufDegs2= DegreePattern (T);
     542            bufDegs1.intersect (bufDegs2);
     543            bufDegs1.refine ();
     544            if (T.length() < 2*s || T.length() == s ||
     545                bufDegs1.getLength() == 1)
    534546            {
    535               result.append (buf);
    536               F= 1;
    537               return result;
     547              delete [] v;
     548              if (recombination)
     549              {
     550                result.append (buf);
     551                F= 1;
     552                return result;
     553              }
     554              else
     555              {
     556                result= CFList (F);
     557                F= 1;
     558                return result;
     559              }
    538560            }
    539             else
    540             {
    541               result= CFList (F);
    542               F= 1;
    543               return result;
    544             }
     561            TT= copy (T);
     562            indexUpdate (v, s, T.length(), nosubset);
     563            if (nosubset) break;
    545564          }
    546           TT= copy (T);
    547           indexUpdate (v, s, T.length(), nosubset);
    548           if (nosubset) break;
    549565        }
    550566      }
Note: See TracChangeset for help on using the changeset viewer.