Changeset f8d2cd2 in git for factory/facAlgFuncUtil.cc


Ignore:
Timestamp:
Sep 7, 2015, 10:43:26 PM (9 years ago)
Author:
Martin Lee <martinlee84@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
c65b73309b230b264308140a3c68d8cf161955a0
Parents:
b6c5b9ea35189a34db58f51d1b3bb752d8b73338
Message:
fix bug in deflateDegree
File:
1 edited

Legend:

Unmodified
Added
Removed
  • factory/facAlgFuncUtil.cc

    rb6c5b9e rf8d2cd2  
    203203  {
    204204    ASSERT (F.deriv().isZero(), "derivative of F is not zero");
    205     int termCount=0;
    206205    CFIterator i= F;
     206    int g= 0;
    207207    for (; i.hasTerms(); i++)
    208     {
    209       if (i.exp() != 0)
    210         termCount++;
    211     }
    212 
    213     int j= 1;
    214     i= F;
    215     for (;j < termCount; j++, i++)
    216       ;
    217 
    218     int exp= i.exp();
     208        g= igcd (g, i.exp());
     209
    219210    int count= 0;
    220211    int p= getCharacteristic();
    221     while ((exp >= p) && (exp != 0) && (exp % p == 0))
    222     {
    223       exp /= p;
     212    while ((g >= p) && (g != 0) && (g % p == 0))
     213    {
     214      g /= p;
    224215      count++;
    225216    }
Note: See TracChangeset for help on using the changeset viewer.