Changeset fd2316c in git


Ignore:
Timestamp:
Sep 10, 2012, 2:46:27 PM (12 years ago)
Author:
Martin Lee <martinlee84@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
c8f95dcff8b4cb5bddaf189cc7eb14c5d52ebe26
Parents:
139f6f800b915490dfaa914ef7676d29a3236b92
git-author:
Martin Lee <martinlee84@web.de>2012-09-10 14:46:27+02:00
git-committer:
Martin Lee <martinlee84@web.de>2012-10-25 15:10:31+02:00
Message:
chg: use flint in computation of univariate gcd and extgcd over Z/Q
File:
1 edited

Legend:

Unmodified
Added
Removed
  • factory/cf_gcd.cc

    r139f6f rfd2316c  
    347347    #endif
    348348  }
     349#ifdef HAVE_FLINT
     350  if (( getCharacteristic() ==0) && (f.level()==g.level())
     351       && isPurePoly(f) && isPurePoly(g))
     352  {
     353    fmpq_poly_t F1, G1;
     354    convertFacCF2Fmpq_poly_t (F1, f);
     355    convertFacCF2Fmpq_poly_t (G1, g);
     356    fmpq_poly_t R, A, B;
     357    fmpq_poly_init (R);
     358    fmpq_poly_init (A);
     359    fmpq_poly_init (B);
     360    fmpq_poly_xgcd (R, A, B, F1, G1);
     361    a= convertFmpq_poly_t2FacCF (A, f.mvar());
     362    b= convertFmpq_poly_t2FacCF (B, f.mvar());
     363    CanonicalForm r= convertFmpq_poly_t2FacCF (R, f.mvar());
     364    fmpq_poly_clear (F1);
     365    fmpq_poly_clear (G1);
     366    fmpq_poly_clear (A);
     367    fmpq_poly_clear (B);
     368    fmpq_poly_clear (R);
     369    return r;
     370  }
     371#else
    349372  if (isOn(SW_USE_NTL_GCD_0) && ( getCharacteristic() ==0)
    350373  && (f.level()==g.level()) && isPurePoly(f) && isPurePoly(g))
     
    383406    }
    384407  }
     408#endif
    385409#endif
    386410  // may contain bug in the co-factors, see track 107
     
    669693    if ( pi.isUnivariate() && pi1.isUnivariate() )
    670694    {
    671 /*#ifdef HAVE_FLINT
     695#ifdef HAVE_FLINT
    672696        if (isPurePoly(pi) && isPurePoly(pi1) )
    673697            return gcd_univar_flint0(pi, pi1 ) * C;
    674 #else*/
     698#else
    675699#ifdef HAVE_NTL
    676700        if ( isOn(SW_USE_NTL_GCD_0) && isPurePoly(pi) && isPurePoly(pi1) )
    677701            return gcd_univar_ntl0(pi, pi1 ) * C;
    678702#endif
    679 //#endif
     703#endif
    680704        return gcd_poly_univar0( pi, pi1, true ) * C;
    681705    }
Note: See TracChangeset for help on using the changeset viewer.