Changeset abde36 in git


Ignore:
Timestamp:
May 9, 2014, 11:10:57 AM (10 years ago)
Author:
Martin Lee <martinlee84@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '38077648e7239f98078663eb941c3c979511150a')
Children:
ec04e88299a064f7c80c463bcdcf43e9db165e5b
Parents:
b17fa5fc9eda365fb2095c16d40c59a2c1e4db02
git-author:
Martin Lee <martinlee84@web.de>2014-05-09 11:10:57+02:00
git-committer:
Martin Lee <martinlee84@web.de>2014-05-12 14:35:03+02:00
Message:
chg: better docu and format
File:
1 edited

Legend:

Unmodified
Added
Removed
  • factory/facAlgFunc.cc

    rb17fa5 rabde36  
    360360                CanonicalForm & R)
    361361{
    362   CFList Returnlist, Bstar=Astar;
    363   CanonicalForm s, g, ra, rb, oldR, h, denra, denrb=1;
     362  CFList Returnlist, Bstar= Astar;
     363  CanonicalForm s, g, ra, rb, oldR, h, denra, denrb= 1;
    364364  Variable alpha;
    365365  CFList tmp;
     
    516516  if (!isRat && getCharacteristic() == 0)
    517517    On (SW_RATIONAL);
    518   numinv= QuasiInverse (Rstar, alg_LC(f, algExtLevel), Rstar.mvar());
     518  numinv= QuasiInverse (Rstar, alg_LC (f, algExtLevel), Rstar.mvar());
    519519
    520520  f *= numinv;
     
    533533  }
    534534
    535   sqrf_norm(f, Rstar, vminpoly, s, g, R );
     535  sqrf_norm (f, Rstar, vminpoly, s, g, R);
    536536
    537537  Variable X;
    538   if (hasFirstAlgVar(R,X))
     538  if (hasFirstAlgVar (R, X))
    539539  {
    540540    // factorize R over alg.extension with X
    541     Factorlist =  factorize( R, X );
     541    Factorlist=  factorize (R, X);
    542542  }
    543543  else
    544544  {
    545545    // factor R over k
    546     Factorlist = factorize(R);
    547   }
    548 
    549   if ( !Factorlist.getFirst().factor().inCoeffDomain() )
    550     Factorlist.insert(CFFactor(1,1));
    551   if ( Factorlist.length() == 2 && Factorlist.getLast().exp()== 1)
    552   { // irreduzibel (first entry is a constant)
     546    Factorlist = factorize (R);
     547  }
     548
     549  if (!Factorlist.getFirst().factor().inCoeffDomain())
     550    Factorlist.insert (CFFactor (1, 1));
     551  if (Factorlist.length() == 2 && Factorlist.getLast().exp()== 1)
     552  {
    553553    f= backSubst (f, backSubsts, Astar);
    554554    f *= bCommonDen (f);
     
    590590    // we are not interested in a
    591591    // constant (over K_r, which can be a polynomial!)
    592     if (degree(g, f.mvar())>0){ L.append(CFFactor(g,1)); }
     592    if (degree (g, f.mvar()) > 0)
     593      L.append (CFFactor (g, 1));
    593594  }
    594595  CFFList LL;
    595   if (getCharacteristic()>0)
     596  if (getCharacteristic() > 0) //do I really need this part?
    596597  {
    597598    CFFListIterator i=L;
     
    905906  if (vf.level() <= as.getLast().level())
    906907  {
    907 // ||( (as.length()==1) && (degree(f,vf)==3) && (degree(as.getFirst()==2)) )
    908908    if (!isRat && getCharacteristic() == 0)
    909909      Off (SW_RATIONAL);
     
    911911  }
    912912
    913 // 2) List of variables:
    914 // 2a) Setup list of those polys in AS having degree(AS[i], AS[i].mvar()) > 1
    915 // 2b) Setup variableordering
     913// 2) Setup list of those polys in AS having degree > 1
    916914  CFList Astar;
    917915  Variable x;
    918916  CanonicalForm elem;
    919917  Varlist ord, uord;
    920   for ( int ii=1; ii< level(vf) ; ii++ ) { uord.append(Variable(ii));  }
    921 
    922   for ( i=as; i.hasItem(); i++ ){
     918  for (int ii= 1; ii < level (vf); ii++)
     919    uord.append (Variable (ii));
     920
     921  for (i= as; i.hasItem(); i++)
     922  {
    923923    elem= i.getItem();
    924924    x= elem.mvar();
    925     if ( degree(elem,x) > 1){ // otherwise it's not an extension
    926       Astar.append(elem);
    927       ord.append(x);
    928     }
    929   }
    930   uord= Difference(uord,ord);
     925    if (degree (elem, x) > 1)  // otherwise it's not an extension
     926    {
     927      Astar.append (elem);
     928      ord.append (x);
     929    }
     930  }
     931  uord= Difference (uord, ord);
    931932
    932933// 3) second trivial cases: we already proved irr. of f over no extensions
    933   if ( Astar.length() == 0 ){
     934  if (Astar.length() == 0)
     935  {
    934936    if (!isRat && getCharacteristic() == 0)
    935937      Off (SW_RATIONAL);
    936     return CFFList(CFFactor(f,1));
    937   }
    938 
    939 // 4) Try to obtain a partial factorization using prop2 and prop3
    940 //    Use with caution! We have to proof these propositions first!
    941   // Not yet implemented
    942 
    943 // 5) Look if elements in uord actually occure in any of the minimal
     938    return CFFList (CFFactor (f, 1));
     939  }
     940
     941// 4) Look if elements in uord actually occur in any of the minimal
    944942//    polynomials. If no element of uord occures in any of the minimal
    945 //   polynomials, we don't have transzendentals.
     943//    polynomials the field is an alg. number field not an alg. function field
    946944  Varlist newuord= varsInAs (uord, Astar);
    947945
    948946  CFFList Factorlist;
    949   Varlist gcdord= Union(ord,newuord);
    950   gcdord.append(f.mvar());
     947  Varlist gcdord= Union (ord, newuord);
     948  gcdord.append (f.mvar());
    951949  bool isFunctionField= (newuord.length() > 0);
    952950
    953   // This is for now. we need alg_sqrfree implemented!
     951  // TODO alg_sqrfree?
    954952  CanonicalForm Fgcd= 0;
    955953  if (isFunctionField)
     
    969967    }
    970968
    971     Fgcd= pp(Fgcd); Ggcd= pp(Ggcd);
     969    Fgcd= pp (Fgcd);
     970    Ggcd= pp (Ggcd);
    972971    if (!isRat && getCharacteristic() == 0)
    973972      Off (SW_RATIONAL);
     
    975974  }
    976975
    977   if ( getCharacteristic() > 0 )
    978   {
    979     // First look for extension!
     976  if (getCharacteristic() > 0)
     977  {
    980978    IntList degreelist;
    981979    Variable vminpoly;
    982     for (i=Astar; i.hasItem(); i++){degreelist.append(degree(i.getItem()));}
    983     int extdeg= getDegOfExt (degreelist, degree(f));
    984 
    985     // Now the real stuff!
    986     if ( newuord.length() == 0 ) // no transzendentals
    987     {
    988       if ( extdeg > 1 ){
     980    for (i= Astar; i.hasItem(); i++)
     981      degreelist.append (degree (i.getItem()));
     982
     983    int extdeg= getDegOfExt (degreelist, degree (f));
     984
     985    if (newuord.length() == 0) // no parameters
     986    {
     987      if (extdeg > 1)
     988      {
    989989        CanonicalForm MIPO= generateMipo (extdeg);
    990990        vminpoly= rootOf(MIPO);
     
    993993      return Factorlist;
    994994    }
    995     else if (isInseparable(Astar) || derivZero) // Look if extensions are separable
    996     {
    997       Factorlist= SteelTrager(f, Astar);
     995    else if (isInseparable(Astar) || derivZero) // inseparable case
     996    {
     997      Factorlist= SteelTrager (f, Astar);
    998998      return Factorlist;
    999999    }
    1000     else{ // we are on the save side: Use trager
    1001       if (extdeg > 1 ){
     1000    else // separable case
     1001    {
     1002      if (extdeg > 1)
     1003      {
    10021004        CanonicalForm MIPO=generateMipo (extdeg);
    1003         vminpoly= rootOf(MIPO);
    1004       }
    1005       Factorlist= Trager(f, Astar, vminpoly, as, isFunctionField);
     1005        vminpoly= rootOf (MIPO);
     1006      }
     1007      Factorlist= Trager (f, Astar, vminpoly, as, isFunctionField);
    10061008      return Factorlist;
    10071009    }
    10081010  }
    1009   else{ // char=0 apply trager directly
     1011  else // char 0
     1012  {
    10101013    Variable vminpoly;
    1011     Factorlist= Trager(f, Astar, vminpoly, as, isFunctionField);
     1014    Factorlist= Trager (f, Astar, vminpoly, as, isFunctionField);
    10121015    if (!isRat && getCharacteristic() == 0)
    10131016      Off (SW_RATIONAL);
     
    10311034    Factors.removeFirst();
    10321035
    1033   if ( as.length() == 0 )
     1036  if (as.length() == 0)
    10341037  {
    10351038    if (!isRat && getCharacteristic() == 0)
     
    10441047  }
    10451048
    1046   for ( CFFListIterator i=Factors; i.hasItem(); i++ )
     1049  for (CFFListIterator i=Factors; i.hasItem(); i++)
    10471050  {
    10481051    if (i.getItem().factor().level() > as.getLast().level())
    10491052    {
    1050       output=facAlgFunc2(i.getItem().factor(), as);
    1051       for ( CFFListIterator j=output; j.hasItem(); j++)
    1052         Output = append(Output,CFFactor(j.getItem().factor(),j.getItem().exp()*i.getItem().exp()));
     1053      output= facAlgFunc2 (i.getItem().factor(), as);
     1054      for (CFFListIterator j= output; j.hasItem(); j++)
     1055        Output= append (Output, CFFactor (j.getItem().factor(),
     1056                                          j.getItem().exp()*i.getItem().exp()));
    10531057    }
    10541058  }
Note: See TracChangeset for help on using the changeset viewer.