Changeset d8a7da in git


Ignore:
Timestamp:
Mar 15, 2013, 1:54:27 PM (11 years ago)
Author:
Martin Lee <martinlee84@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
93e7364ff81efde654648b43b93070f1ff358dfe
Parents:
cd429e3b827c72970f7c3db6b3b3d12f45e000f0
git-author:
Martin Lee <martinlee84@web.de>2013-03-15 13:54:27+01:00
git-committer:
Martin Lee <martinlee84@web.de>2013-03-22 15:52:34+01:00
Message:
chg: added new function to compute bounds wrt different main var
Location:
factory
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • factory/facFqBivarUtil.cc

    rcd429e rd8a7da  
    735735}
    736736
     737int *
     738computeBoundsWrtDiffMainvar (const CanonicalForm& F, int& n,
     739                             bool& isIrreducible)
     740{
     741  n= degree (F, 2);
     742  int* result= new int [n];
     743  int sizeOfNewtonPolygon;
     744  int** newtonPolyg= newtonPolygon (F, sizeOfNewtonPolygon);
     745
     746  isIrreducible= false;
     747  if (sizeOfNewtonPolygon == 3)
     748  {
     749    bool check1=
     750        (newtonPolyg[0][0]==0 || newtonPolyg[1][0]==0 || newtonPolyg[2][0]==0);
     751    if (check1)
     752    {
     753      bool check2=
     754        (newtonPolyg[0][1]==0 || newtonPolyg[1][1]==0 || newtonPolyg[2][0]==0);
     755      if (check2)
     756      {
     757        int p=getCharacteristic();
     758        int d=1;
     759        char bufGFName='Z';
     760        bool GF= (CFFactory::gettype()==GaloisFieldDomain);
     761        if (GF)
     762        {
     763          d= getGFDegree();
     764          bufGFName=gf_name;
     765        }
     766        setCharacteristic(0);
     767        CanonicalForm tmp= gcd (newtonPolyg[0][0],newtonPolyg[0][1]);
     768        tmp= gcd (tmp, newtonPolyg[1][0]);
     769        tmp= gcd (tmp, newtonPolyg[1][1]);
     770        tmp= gcd (tmp, newtonPolyg[2][0]);
     771        tmp= gcd (tmp, newtonPolyg[2][1]);
     772        isIrreducible= (tmp==1);
     773        if (GF)
     774          setCharacteristic (p, d, bufGFName);
     775        else
     776          setCharacteristic(p);
     777      }
     778    }
     779  }
     780
     781  int minX, minY, maxX, maxY;
     782  minX= newtonPolyg [0] [0];
     783  minY= newtonPolyg [0] [1];
     784  maxX= minX;
     785  maxY= minY;
     786  for (int i= 1; i < sizeOfNewtonPolygon; i++)
     787  {
     788    if (minX > newtonPolyg [i] [0])
     789      minX= newtonPolyg [i] [0];
     790    if (maxX < newtonPolyg [i] [0])
     791      maxX= newtonPolyg [i] [0];
     792    if (minY > newtonPolyg [i] [1])
     793      minY= newtonPolyg [i] [1];
     794    if (maxY < newtonPolyg [i] [1])
     795      maxY= newtonPolyg [i] [1];
     796  }
     797
     798  int k= maxY;
     799  for (int i= 0; i < n; i++)
     800  {
     801    if (i + 1 > maxX || i + 1 < minX)
     802    {
     803      result [i]= 0;
     804      continue;
     805    }
     806    int* point= new int [2];
     807    point [0]= i + 1;
     808    point [1]= k;
     809    while (!isInPolygon (newtonPolyg, sizeOfNewtonPolygon, point) && k > 0)
     810    {
     811      k--;
     812      point [1]= k;
     813    }
     814    result [i]= k;
     815    k= maxY;
     816    delete [] point;
     817  }
     818
     819  return result;
     820}
     821
    737822int
    738823substituteCheck (const CanonicalForm& F, const Variable& x)
  • factory/facFqBivarUtil.h

    rcd429e rd8a7da  
    210210              );
    211211
     212/// as above just wrt to the other variable
     213///
     214/// @return @a computeBounds returns bounds as described above
     215int *
     216computeBoundsWrtDiffMainvar
     217              (const CanonicalForm& F,///< [in] compressed bivariate polynomial
     218               int& n,                ///< [in,out] length of output
     219               bool& isIrreducible    ///< [in,out] check if poly is irreducible
     220              );
     221
    212222/// extract coefficients of \f$ x^i \f$ for \f$i\geq k\f$ where \f$ x \f$ is
    213223/// a variable of level 1
Note: See TracChangeset for help on using the changeset viewer.