Changeset e26667 in git


Ignore:
Timestamp:
May 2, 2012, 2:00:57 PM (12 years ago)
Author:
Martin Lee <martinlee84@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '38077648e7239f98078663eb941c3c979511150a')
Children:
2156ec376c4c5977dc1fc4a9186651db3fdf492d
Parents:
59778389f5075553bef793320610ce298d74b18d
git-author:
Martin Lee <martinlee84@web.de>2012-05-02 14:00:57+02:00
git-committer:
Martin Lee <martinlee84@web.de>2012-05-07 14:17:00+02:00
Message:
chg: use cofactors in EZGCD to test divisibility
Location:
factory
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • factory/cf_gcd_smallp.cc

    r597783 re26667  
    46284628  }
    46294629
    4630   CanonicalForm cand;
     4630  CanonicalForm cand, contcand;
    46314631  CanonicalForm result;
    46324632  int o, t;
     
    48714871      if (gcdfound == 1)
    48724872      {
    4873         cand = DD[2] / content( DD[2], Variable(1) );
    4874         gcdfound = fdivides( cand, G ) && fdivides ( cand, F ); //TODO use multiplication instead of fdivides
     4873        contcand= content (DD[2], Variable (1));
     4874        cand = DD[2] / contcand;
     4875        if (B_is_F)
     4876          gcdfound = fdivides( cand, G ) && cand*(DD[1]/(lcD/contcand)) == F;
     4877        else
     4878          gcdfound = fdivides( cand, F ) && cand*(DD[1]/(lcD/contcand)) == G;
    48754879
    48764880        if (passToGF && gcdfound)
  • factory/fac_ezgcd.cc

    r597783 re26667  
    414414  bool isRat= isOn (SW_RATIONAL);
    415415  CanonicalForm F, G, f, g, d, Fb, Gb, Db, Fbt, Gbt, Dbt, B0, B, D0, lcF, lcG,
    416                 lcD, cand, result;
     416                lcD, cand, contcand, result;
    417417  CFArray DD( 1, 2 ), lcDD( 1, 2 );
    418418  int degF, degG, delta, t, count, maxeval;
     
    654654      if (gcdfound)
    655655      {
    656         cand = DD[2] / content( DD[2], Variable(1) );
    657         gcdfound = fdivides( cand, G ) && fdivides ( cand, F );
     656        contcand= content (DD[2], Variable (1));
     657        cand = DD[2] / contcand;
     658        if (B_is_F)
     659          gcdfound = fdivides( cand, G ) && cand*(DD[1]/(lcD/contcand)) == F;
     660        else
     661          gcdfound = fdivides( cand, F ) && cand*(DD[1]/(lcD/contcand)) == G;
    658662      }
    659663      /// ---> A8 (gcdfound)
Note: See TracChangeset for help on using the changeset viewer.