Changeset ea0a9d in git


Ignore:
Timestamp:
Mar 12, 2014, 2:17:29 PM (10 years ago)
Author:
Martin Lee <martinlee84@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
ac2c3043b7a7c6fd15fe58c2089a7df5c1daf4ad
Parents:
574650d154909eac6bd00ddec8f7f5ff0828b7a7
git-author:
Martin Lee <martinlee84@web.de>2014-03-12 14:17:29+01:00
git-committer:
Hans Schoenemann <hannes@mathematik.uni-kl.de>2014-03-17 18:31:55+01:00
Message:
chg: compute back substitutions
File:
1 edited

Legend:

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

    r574650 rea0a9d  
    580580// K must have more than S elements (->thesis, -> getextension)
    581581static CFList
    582 simpleextension(const CFList & Astar, const Variable & Extension, bool& isFunctionField,
     582simpleextension(CFList& backSubst, const CFList & Astar,
     583                const Variable & Extension, bool& isFunctionField,
    583584                CanonicalForm & R)
    584585{
     
    612613      oldR= R;
    613614      sqrf_norm (i.getItem(), R, Extension, s, g, R);
     615
     616      backSubst.insert (s);
    614617
    615618      Off (SW_RATIONAL);
     
    729732}
    730733
     734CanonicalForm
     735backSubst (const CanonicalForm& F, const CFList& a, const CFList& b)
     736{
     737  ASSERT (a.length() == b.length() - 1, "wrong length of lists in backSubst");
     738  CanonicalForm result= F;
     739  Variable tmp;
     740  CFList tmp2= b;
     741  tmp= tmp2.getLast().mvar();
     742  tmp2.removeLast();
     743  for (CFListIterator iter= a; iter.hasItem(); iter++)
     744  {
     745    result= result (tmp+iter.getItem()*tmp2.getLast().mvar(), tmp);
     746    tmp= tmp2.getLast().mvar();
     747    tmp2.removeLast();
     748  }
     749  return result;
     750}
     751
    731752// the heart of the algorithm: the one from Trager
    732753#ifndef DEBUGOUTPUT
     
    740761  CFFList L, Factorlist;
    741762  CanonicalForm R, Rstar, s, g, h, f= F;
    742   CFList substlist;
     763  CFList substlist, backSubsts;
    743764
    744765  DEBINCLEVEL(CERR,"alg_factor");
    745766  DEBOUTLN(CERR, "alg_factor: f= ", f);
    746767
    747   //out_cf("start alg_factor:",f,"\n");
    748   substlist= simpleextension(Astar, vminpoly, isFunctionField, Rstar);
     768  substlist= simpleextension (backSubsts, Astar, vminpoly, isFunctionField, Rstar);
    749769  DEBOUTLN(CERR, "alg_factor: substlist= ", substlist);
    750770  DEBOUTLN(CERR, "alg_factor: minpoly Rstar= ", Rstar);
     
    768788        h= replacevar (h, alpha, Rstar.mvar());
    769789        h *= bCommonDen(h);
     790        h= backSubst (h, backSubsts, Astar);
    770791        h= Prem (h, as);
    771792        L.append (CFFactor (h, i.getItem().exp()));
     
    846867      {
    847868        g= divide (g, h, Rstarlist);
     869        h= backSubst (h, backSubsts, Astar);
    848870        h= Prem (h, as);
    849871        h *= bCommonDen (h);
Note: See TracChangeset for help on using the changeset viewer.