Changeset 574650 in git


Ignore:
Timestamp:
Mar 12, 2014, 2:05:02 PM (10 years ago)
Author:
Martin Lee <martinlee84@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '4188d308699580d975efd0f6cca8dcb41c396f70')
Children:
ea0a9dfbfc8e8cda45b109756bdf6380f6d26c3d
Parents:
115a9a7ad94ec1b8b7411e434ab5de5027c3d68e
git-author:
Martin Lee <martinlee84@web.de>2014-03-12 14:05:02+01:00
git-committer:
Hans Schoenemann <hannes@mathematik.uni-kl.de>2014-03-17 18:31:55+01:00
Message:
chg: better recovery of factors
File:
1 edited

Legend:

Unmodified
Added
Removed
  • factory/libfac/charset/alg_factor.cc

    r115a9a r574650  
    821821  else
    822822  {
     823    g= f;
    823824    DEBOUTLN(CERR, "alg_factor: g= ", g);
    824     CanonicalForm gnew= g(s,s.mvar());
    825     DEBOUTLN(CERR, "alg_factor: gnew= ", gnew);
    826     g=gnew;
    827825    for ( CFFListIterator i=Factorlist; i.hasItem(); i++)
    828826    {
    829827      CanonicalForm fnew=i.getItem().factor();
    830       fnew= fnew(s,s.mvar());
     828      if (fnew.level() < Rstar.level()) //factor is a constant from the function field
     829        continue;
     830      else
     831      {
     832        fnew= fnew (g.mvar()+s*Rstar.mvar(), g.mvar());
     833        fnew= reduce (fnew, Rstar);
     834      }
     835
    831836      DEBOUTLN(CERR, "alg_factor: fnew= ", fnew);
    832       DEBOUTLN(CERR, "alg_factor: substlist= ", substlist);
    833       for ( CFListIterator ii=substlist; ii.hasItem(); ii++){
    834         DEBOUTLN(CERR, "alg_factor: item= ", ii.getItem());
    835         fnew= fnew(ii.getItem(), ii.getItem().mvar());
    836         DEBOUTLN(CERR, "alg_factor: fnew= ", fnew);
    837       }
    838       if (degree(i.getItem().factor()) > 0 )
     837
     838      h= alg_gcd (g, fnew, Rstarlist);
     839      QuasiInverse(Rstar, LC(h), numt, Rstar.mvar());
     840      dent= 1;
     841      h *= numt;
     842      h= Prem (h, Rstarlist);
     843      h /= vcontent (h, Rstar.mvar());
     844
     845      if (h.level() >= Rstar.level())
    839846      {
    840           h=alg_gcd(g,fnew,as);
    841         DEBOUTLN(CERR, "  alg_factor: h= ", h);
    842         DEBOUTLN(CERR, "  alg_factor: oldord= ", oldord);
    843         if ( degree(h) > 0 )
    844         { //otherwise it's a constant
    845           g= divide(g, h,as);
    846           DEBOUTLN(CERR, "alg_factor: g/h= ", g);
    847           DEBOUTLN(CERR, "alg_factor: s= ", s);
    848           DEBOUTLN(CERR, "alg_factor: substlist= ", substlist);
    849           //out_cf("new g:",g,"\n");
    850           L.append(CFFactor(h,1));
    851         }
    852         //else printf("degree <=1\n");
     847        g= divide (g, h, Rstarlist);
     848        h= Prem (h, as);
     849        h *= bCommonDen (h);
     850        h /= vcontent (h, as.getFirst().mvar());
     851        L.append (CFFactor (h, 1));
    853852      }
    854853    }
Note: See TracChangeset for help on using the changeset viewer.