Changeset 4704674 in git for factory/cf_gcd_smallp.cc


Ignore:
Timestamp:
Apr 26, 2012, 10:46:57 AM (12 years ago)
Author:
Martin Lee <martinlee84@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
cb7827a842fd2e9878498f940e9f7735fdbe488e
Parents:
9f84ad2f3376850c4d78697edb203d32c07d3094
git-author:
Martin Lee <martinlee84@web.de>2012-04-26 10:46:57+02:00
git-committer:
Martin Lee <martinlee84@web.de>2012-05-07 14:16:24+02:00
Message:
chg: avoid divisibility tests
chg: use a bound on coeffs in chinrem_gcd
File:
1 edited

Legend:

Unmodified
Added
Removed
  • factory/cf_gcd_smallp.cc

    r9f84ad r4704674  
    560560  CanonicalForm prim_elem, im_prim_elem;
    561561  CFList source, dest;
     562  int bound= tmin (degree (ppA, 1), degree (ppB, 1));
     563  int count= 0;
    562564  do
    563565  {
     
    665667      G_m= 0;
    666668      d= d0;
     669      count= 0;
    667670    }
    668671
     
    672675                          "time for newton interpolation: ");
    673676
     677    count++;
    674678    //termination test
    675679    if (uni_lcoeff (H) == gcdlcAlcB)
     
    682686        //maybe it's better to test if ppH is an element of F(\alpha) before
    683687        //mapping down
    684         if (fdivides (ppH, ppA) && fdivides (ppH, ppB))
     688        DEBOUTLN (cerr, "ppH before mapDown= " << ppH);
     689        ppH= mapDown (ppH, prim_elem, im_prim_elem, alpha, u, v);
     690        ppH /= Lc(ppH);
     691        DEBOUTLN (cerr, "ppH after mapDown= " << ppH);
     692        if ((count == bound) || (fdivides (ppH, ppA) && fdivides (ppH, ppB)))
    685693        {
    686694          DEBOUTLN (cerr, "ppH before mapDown= " << ppH);
     
    693701        }
    694702      }
    695       else if (fdivides (ppH, ppA) && fdivides (ppH, ppB))
     703      else if ((count == bound) || (fdivides (ppH, ppA) && fdivides (ppH, ppB)))
    696704      {
    697705        if (compressConvexDense)
     
    882890  int expon;
    883891  char gf_name_buf= gf_name;
     892  int bound= tmin (degree (ppA, 1), degree (ppB, 1));
     893  int count= 0;
    884894  do
    885895  {
     
    963973      G_m= 0;
    964974      d= d0;
     975      count= 0;
    965976    }
    966977
     
    969980    TIMING_END_AND_PRINT (newton_interpolation, "time for newton interpolation: ");
    970981
     982    count++;
    971983    //termination test
    972984    if (uni_lcoeff (H) == gcdlcAlcB)
     
    976988      if (inextension)
    977989      {
    978         if (fdivides(ppH, ppA) && fdivides(ppH, ppB))
     990        if ((count == bound) || (fdivides(ppH, ppA) && fdivides(ppH, ppB)))
    979991        {
    980992          DEBOUTLN (cerr, "ppH before mapDown= " << ppH);
     
    11861198  topLevel= false;
    11871199  CFList source, dest;
     1200  int bound= tmin (degree (ppA, 1), degree (ppB, 1));
     1201  int count= 0;
    11881202  do
    11891203  {
     
    13321346      G_m= 0;
    13331347      d= d0;
     1348      count= 0;
    13341349    }
    13351350
     
    13391354                          "time for newton_interpolation: ");
    13401355
     1356    count++;
    13411357    //termination test
    13421358    if (uni_lcoeff (H) == gcdlcAlcB)
     
    13461362      ppH /= Lc (ppH);
    13471363      DEBOUTLN (cerr, "ppH= " << ppH);
    1348       if (fdivides (ppH, ppA) && fdivides (ppH, ppB))
     1364      if ((count == bound) || (fdivides (ppH, ppA) && fdivides (ppH, ppB)))
    13491365      {
    13501366        if (compressConvexDense)
Note: See TracChangeset for help on using the changeset viewer.