Changeset c74742 in git


Ignore:
Timestamp:
Jul 31, 2019, 2:24:45 PM (4 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '0604212ebb110535022efecad887940825b97c3f')
Children:
5cf321599c682cc78b4e3d193a6942c4b89223b2
Parents:
6ca326dd0aa9608cd34d22903d3d6a579fde9c80
Message:
fix: content for gcd
File:
1 edited

Legend:

Unmodified
Added
Removed
  • factory/FLINTconvert.cc

    r6ca326 rc74742  
    752752}
    753753
     754static CanonicalForm b_content ( const CanonicalForm & f )
     755{
     756    if ( f.inCoeffDomain() )
     757        return f;
     758    else
     759    {
     760        CanonicalForm result = 0;
     761        CFIterator i;
     762        for ( i = f; i.hasTerms() && (!result.isOne()); i++ )
     763            result=bgcd( b_content(i.coeff()) , result );
     764        return result;
     765    }
     766}
     767
     768
    754769CanonicalForm gcdFlintMP_QQ(const CanonicalForm& F, const CanonicalForm& G)
    755770{
     
    781796    RES=convFlintMPFactoryP(res,ctx,N);
    782797    // gcd(2x,4x) should be 2x, so RES should also have the gcd(lc(F),lc(G))
    783     RES*=gcd(F.lc(),G.lc());
     798    RES*=bgcd(b_content(F),b_content(G));
    784799  }
    785800  fmpq_mpoly_clear(res,ctx);
Note: See TracChangeset for help on using the changeset viewer.