Changeset 542864 in git


Ignore:
Timestamp:
May 10, 2012, 12:20:57 PM (12 years ago)
Author:
Martin Lee <martinlee84@…>
Branches:
(u'spielwiese', '5b153614cbc72bfa198d75b1e9e33dab2645d9fe')
Children:
9752db56bd70fbd38b267a2485e46bc0758823a5
Parents:
e89ff5740c084fd5cddf6186f601b597b3a47538
git-author:
Martin Lee <martinlee84@web.de>2012-05-10 12:20:57+02:00
git-committer:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2012-05-15 18:37:45+02:00
Message:
chg: use irreducibility criterion
Location:
factory
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • factory/facFqBivar.cc

    re89ff5 r542864  
    22832283{
    22842284  int d;
    2285   int* bounds= computeBounds (F, d);
     2285  bool isIrreducible= false;
     2286  int* bounds= computeBounds (F, d, isIrreducible);
     2287  if (isIrreducible)
     2288  {
     2289    delete [] bounds;
     2290    CanonicalForm G= F;
     2291    F= 1;
     2292    return CFList (G);
     2293  }
    22862294  CFArray * A= new CFArray [factors.length()];
    22872295  CFArray bufQ= CFArray (factors.length());
     
    24142422{
    24152423  int d;
    2416   int* bounds= computeBounds (F, d);
     2424  bool isIrreducible= false;
     2425  int* bounds= computeBounds (F, d, isIrreducible);
     2426  if (isIrreducible)
     2427  {
     2428    delete [] bounds;
     2429    CanonicalForm G= F;
     2430    F= 1;
     2431    return CFList (G);
     2432  }
    24172433  CFArray * A= new CFArray [factors.length()];
    24182434  CFArray bufQ= CFArray (factors.length());
     
    24772493          delete [] A;
    24782494          delete [] bounds;
    2479           return CFList (F);
     2495          CanonicalForm G= F;
     2496          F= 1;
     2497          return CFList (G);
    24802498        }
    24812499      }
     
    25472565  Variable alpha= info.getAlpha();
    25482566  int d;
    2549   int* bounds= computeBounds (F, d);
     2567  bool isIrreducible= false;
     2568  int* bounds= computeBounds (F, d, isIrreducible);
     2569  if (isIrreducible)
     2570  {
     2571    delete [] bounds;
     2572    CanonicalForm G= F;
     2573    F= 1;
     2574    return CFList (G);
     2575  }
    25502576
    25512577  CFArray * A= new CFArray [factors.length()];
     
    26682694          delete [] A;
    26692695          delete [] bounds;
     2696          F= 1;
    26702697          return CFList (tmp);
    26712698        }
     
    27342761{
    27352762  int d;
    2736   int* bounds= computeBounds (F, d);
     2763  bool isIrreducible= false;
     2764  int* bounds= computeBounds (F, d, isIrreducible);
     2765  if (isIrreducible)
     2766  {
     2767    delete [] bounds;
     2768    return CFList (F);
     2769  }
    27372770  CFArray * A= new CFArray [factors.length()];
    27382771  CFArray bufQ= CFArray (factors.length());
     
    28542887{
    28552888  int d;
    2856   int* bounds= computeBounds (F, d);
     2889  bool isIrreducible= false;
     2890  int* bounds= computeBounds (F, d, isIrreducible);
     2891  if (isIrreducible)
     2892  {
     2893    delete [] bounds;
     2894    CanonicalForm G= F;
     2895    F= 1;
     2896    return CFList (G);
     2897  }
    28572898  int extensionDeg= degree (getMipo (alpha));
    28582899  CFArray * A= new CFArray [factors.length()];
     
    29182959          delete [] A;
    29192960          delete [] bounds;
    2920           return CFList (F);
     2961          CanonicalForm G= F;
     2962          F= 1;
     2963          return CFList (G);
    29212964        }
    29222965      }
     
    45614604  Variable x= Variable (1);
    45624605  int d;
    4563   int* bounds= computeBounds (F, d);
    4564 
     4606  bool isIrreducible= false;
     4607  int* bounds= computeBounds (F, d, isIrreducible);
     4608  if (isIrreducible)
     4609  {
     4610    delete [] bounds;
     4611    return CFList (G);
     4612  }
    45654613  int minBound= bounds[0];
    45664614  for (int i= 1; i < d; i++)
     
    46304678    F= H;
    46314679    delete [] bounds;
    4632     bounds= computeBounds (F, d);
     4680    bounds= computeBounds (F, d, isIrreducible);
     4681    if (isIrreducible)
     4682    {
     4683      smallFactors.append (F);
     4684      delete [] bounds;
     4685      return smallFactors;
     4686    }
    46334687    LCF= LC (F, 1);
    46344688
     
    51075161
    51085162  delete [] bounds;
    5109   bounds= computeBounds (F, d);
     5163  bounds= computeBounds (F, d, isIrreducible);
     5164  if (isIrreducible)
     5165  {
     5166    delete [] bounds;
     5167    result= Union (result, smallFactors);
     5168    result.append (F);
     5169    return result;
     5170  }
    51105171  minBound= bounds[0];
    51115172  for (int i= 1; i < d; i++)
     
    52145275
    52155276  int d;
    5216   int* bounds= computeBounds (F, d);
     5277  bool isIrreducible= false;
     5278  int* bounds= computeBounds (F, d, isIrreducible);
     5279  if (isIrreducible)
     5280  {
     5281    delete [] bounds;
     5282    return CFList (F);
     5283  }
    52175284  int minBound= bounds[0];
    52185285  for (int i= 1; i < d; i++)
     
    52865353    F= H;
    52875354    delete [] bounds;
    5288     bounds= computeBounds (F, d);
     5355    bounds= computeBounds (F, d, isIrreducible);
     5356    if (isIrreducible)
     5357    {
     5358      delete [] bounds;
     5359      CFList source, dest;
     5360      CanonicalForm tmp= F (y - evaluation, y);
     5361      tmp= mapDown (tmp, info, source, dest);
     5362      smallFactors.append (tmp);
     5363      return smallFactors;
     5364    }
    52895365    LCF= LC (F, 1);
    52905366
     
    55775653
    55785654  delete [] bounds;
    5579   bounds= computeBounds (F, d);
     5655  bounds= computeBounds (F, d, isIrreducible);
     5656  if (isIrreducible)
     5657  {
     5658    delete [] bounds;
     5659    CFList source, dest;
     5660    CanonicalForm tmp= F (y - evaluation, y);
     5661    tmp= mapDown (tmp, info, source, dest);
     5662    smallFactors.append (tmp);
     5663    result= Union (result, smallFactors);
     5664    return result;
     5665  }
    55805666  minBound= bounds[0];
    55815667  for (int i= 1; i < d; i++)
     
    57485834  }
    57495835
     5836  int boundsLength;
     5837  bool isIrreducible= false;
     5838  int * bounds= computeBounds (A, boundsLength, isIrreducible);
     5839  if (isIrreducible)
     5840  {
     5841    delete [] bounds;
     5842    factors.append (A);
     5843
     5844    appendSwapDecompress (factors, contentAxFactors, contentAyFactors,
     5845                          swap, false, N);
     5846
     5847    normalize (factors);
     5848    return factors;
     5849  }
     5850
    57505851  bool fail= false;
    57515852  CanonicalForm Aeval, evaluation, bufAeval, bufEvaluation, buf;
     
    59616062  int liftBound= degree (A, y) + 1;
    59626063
    5963   int boundsLength;
    5964   int * bounds= computeBounds (A, boundsLength);
     6064  if (swap2)
     6065    bounds= computeBounds (A, boundsLength, isIrreducible);
     6066
    59656067  int minBound= bounds[0];
    59666068  for (int i= 1; i < boundsLength; i++)
  • factory/facFqBivarUtil.cc

    re89ff5 r542864  
    662662#endif
    663663
    664 int * computeBounds (const CanonicalForm& F, int& n)
     664int * computeBounds (const CanonicalForm& F, int& n, bool& isIrreducible)
    665665{
    666666  n= degree (F, 1);
     
    668668  int sizeOfNewtonPolygon;
    669669  int** newtonPolyg= newtonPolygon (F, sizeOfNewtonPolygon);
     670
     671  isIrreducible= false;
     672  if (sizeOfNewtonPolygon == 3)
     673  {
     674    bool check1=
     675        (newtonPolyg[0][0]==0 || newtonPolyg[1][0]==0 || newtonPolyg[2][0]==0);
     676    if (check1)
     677    {
     678      bool check2=
     679        (newtonPolyg[0][1]==0 || newtonPolyg[1][1]==0 || newtonPolyg[2][0]==0);
     680      if (check2)
     681      {
     682        int p=getCharacteristic();
     683        int d=1;
     684        char bufGFName='Z';
     685        bool GF= (CFFactory::gettype()==GaloisFieldDomain);
     686        if (GF)
     687        {
     688          d= getGFDegree();
     689          bufGFName=gf_name;
     690        }
     691        setCharacteristic(0);
     692        CanonicalForm tmp= gcd (newtonPolyg[0][0],newtonPolyg[0][1]);
     693        tmp= gcd (tmp, newtonPolyg[1][0]);
     694        tmp= gcd (tmp, newtonPolyg[1][1]);
     695        tmp= gcd (tmp, newtonPolyg[2][0]);
     696        tmp= gcd (tmp, newtonPolyg[2][1]);
     697        isIrreducible= (tmp==1);
     698        if (GF)
     699          setCharacteristic (p, d, bufGFName);
     700        else
     701          setCharacteristic(p);
     702      }
     703    }
     704  }
    670705
    671706  int minX, minY, maxX, maxY;
  • factory/facFqBivarUtil.h

    re89ff5 r542864  
    208208int *
    209209computeBounds (const CanonicalForm& F,///< [in] compressed bivariate polynomial
    210                int& n                 ///< [in,out] length of output
     210               int& n,                ///< [in,out] length of output
     211               bool& isIrreducible    ///< [in,out] check if poly is irreducible
    211212              );
    212213
Note: See TracChangeset for help on using the changeset viewer.