Changeset 863b03 in git


Ignore:
Timestamp:
Mar 17, 2014, 8:35:01 PM (10 years ago)
Author:
Martin Lee <martinlee84@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
9c9ed172d6031851741d232b305ae98555a7d88f
Parents:
789a7e93154cff0756258fc1aea3331cb78f20a8
git-author:
Martin Lee <martinlee84@web.de>2014-03-17 20:35:01+01:00
git-committer:
Martin Lee <martinlee84@web.de>2014-03-18 12:02:41+01:00
Message:
fix: handling of SW_RATIONAL
File:
1 edited

Legend:

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

    r789a7e r863b03  
    10301030newfactoras( const CanonicalForm & f, const CFList & as, int &success)
    10311031{
     1032  bool isRat= isOn (SW_RATIONAL);
     1033  if (!isRat)
     1034    On (SW_RATIONAL);
    10321035  Variable vf=f.mvar();
    10331036  CFListIterator i;
     
    10501053// ||( (as.length()==1) && (degree(f,vf)==3) && (degree(as.getFirst()==2)) )
    10511054    DEBDECLEVEL(CERR,"newfactoras");
     1055    if (!isRat)
     1056      Off (SW_RATIONAL);
    10521057    return CFFList(CFFactor(f,1));
    10531058  }
     
    10791084  if ( Astar.length() == 0 ){
    10801085    DEBDECLEVEL(CERR,"newfactoras");
     1086    if (!isRat)
     1087      Off (SW_RATIONAL);
    10811088    return CFFList(CFFactor(f,1));
    10821089  }
     
    11101117      CFFList result= newfactoras (Ggcd,as,success); //Ggcd is the squarefree part of f
    11111118      multiplicity (result, f, Astar);
     1119      if (!isRat)
     1120        Off (SW_RATIONAL);
    11121121      return result;
    11131122    }
     
    11161125    Fgcd= pp(Fgcd); Ggcd= pp(Ggcd);
    11171126    DEBDECLEVEL(CERR,"newfactoras");
     1127    if (!isRat)
     1128      Off (SW_RATIONAL);
    11181129    return myUnion(newfactoras(Fgcd,as,success) , newfactoras(Ggcd,as,success));
    11191130  }
    11201131  if ( getCharacteristic() > 0 )
    11211132  {
     1133    if (!isRat)
     1134      Off (SW_RATIONAL);
    11221135    // First look for extension!
    11231136    IntList degreelist;
     
    11641177    Variable vminpoly;
    11651178    Factorlist= alg_factor(f, Astar, vminpoly, oldord, as, isFunctionField);
    1166       DEBDECLEVEL(CERR,"newfactoras");
    1167       return Factorlist;
     1179    DEBDECLEVEL(CERR,"newfactoras");
     1180    if (!isRat)
     1181      Off (SW_RATIONAL);
     1182    return Factorlist;
    11681183  }
    11691184
     
    11751190newcfactor(const CanonicalForm & f, const CFList & as, int & success )
    11761191{
    1177   On (SW_RATIONAL);
     1192  bool isRat= isOn (SW_RATIONAL);
     1193  if (!isRat)
     1194    On (SW_RATIONAL);
    11781195  CFFList Output, output, Factors= factorize(f);
    11791196  if (Factors.getFirst().factor().inCoeffDomain())
     
    11821199  if ( as.length() == 0 )
    11831200  {
     1201    if (!isRat)
     1202      Off (SW_RATIONAL);
    11841203    success=1;
    11851204    return Factors;
     
    11871206  if ( cls(f) <= cls(as.getLast()) )
    11881207  {
     1208    if (!isRat)
     1209      Off (SW_RATIONAL);
    11891210    success=1;
    11901211    return Factors;
     
    11981219      Output = myappend(Output,CFFactor(j.getItem().factor(),j.getItem().exp()*i.getItem().exp()));
    11991220  }
     1221
     1222  if (!isRat)
     1223    Off (SW_RATIONAL);
    12001224  return Output;
    12011225}
Note: See TracChangeset for help on using the changeset viewer.