Changeset 5b2d2b in git


Ignore:
Timestamp:
Nov 5, 2012, 3:23:36 PM (11 years ago)
Author:
Martin Lee <martinlee84@…>
Branches:
(u'spielwiese', 'd28bb9fd81d9b3c28434941de2792173765710d2')
Children:
6e88340150f9c8853246d5e107fab8042207d29e
Parents:
2024b69d96cd514f5fac583c96dda89d4e94215c
git-author:
Martin Lee <martinlee84@web.de>2012-11-05 15:23:36+01:00
git-committer:
Martin Lee <martinlee84@web.de>2012-11-16 13:16:26+01:00
Message:
fix: gcd_test_one now checks for coprimality over extension
chg: gcd_test_one returns degree of gcd used to check for coprimality
Location:
factory
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • factory/cf_gcd.cc

    r2024b69 r5b2d2b  
    4545
    4646bool
    47 gcd_test_one ( const CanonicalForm & f, const CanonicalForm & g, bool swap )
    48 {
     47gcd_test_one ( const CanonicalForm & f, const CanonicalForm & g, bool swap, int & d )
     48{
     49    d= 0;
    4950    int count = 0;
    5051    // assume polys have same level;
     
    218219    }
    219220
    220     if ( eval1.taildegree() > 0 && eval2.taildegree() > 0 )
    221     {
    222         if (passToGF)
    223           setCharacteristic (p);
    224         if (k > 1)
    225           setCharacteristic (p, k, gf_name);
    226         return false;
    227     }
    228 
    229221    CanonicalForm c= gcd (eval1, eval2);
    230     bool result= c.degree() < 1;
     222    d= c.degree();
     223    bool result= d < 1;
     224    if (d < 0)
     225      d= 0;
    231226
    232227    if (passToGF)
     
    620615    pi1 = pi1 / Ci1; pi = pi / Ci;
    621616    C = gcd( Ci, Ci1 );
     617    int d= 0;
    622618    if ( !( pi.isUnivariate() && pi1.isUnivariate() ) )
    623619    {
    624         if ( gcd_test_one( pi1, pi, true ) )
     620        if ( gcd_test_one( pi1, pi, true, d ) )
    625621        {
    626622          C=abs(C);
     
    739735    pi1 = pi1 / Ci1; pi = pi / Ci;
    740736    C = gcd( Ci, Ci1 );
     737    int d= 0;
    741738    if ( pi.isUnivariate() && pi1.isUnivariate() )
    742739    {
     
    752749        return gcd_poly_univar0( pi, pi1, true ) * C;
    753750    }
    754     else if ( gcd_test_one( pi1, pi, true ) )
     751    else if ( gcd_test_one( pi1, pi, true, d ) )
    755752      return C;
    756753    Variable v = f.mvar();
  • factory/cf_gcd_smallp.cc

    r2024b69 r5b2d2b  
    45474547  }
    45484548
    4549   if( gcd_test_one( F, G, false ) )
     4549  int dummy= 0;
     4550  if( gcd_test_one( F, G, false, dummy ) )
    45504551  {
    45514552    return N (d);
  • factory/fac_ezgcd.cc

    r2024b69 r5b2d2b  
    492492  }
    493493
    494   if ( gcd_test_one( F, G, false ) )
     494  int dummy= 0;
     495  if ( gcd_test_one( F, G, false, dummy ) )
    495496  {
    496497    DEBDECLEVEL( cerr, "ezgcd" );
  • factory/fac_util.h

    r2024b69 r5b2d2b  
    5454/*ENDPUBLIC*/
    5555
    56 bool gcd_test_one ( const CanonicalForm & f, const CanonicalForm & g, bool swap );
     56bool gcd_test_one ( const CanonicalForm & f, const CanonicalForm & g, bool swap, int & d );
    5757
    5858CanonicalForm ezgcd ( const CanonicalForm & f, const CanonicalForm & g );
Note: See TracChangeset for help on using the changeset viewer.