Changeset c1b9927 in git


Ignore:
Timestamp:
Jun 7, 2011, 3:27:18 PM (13 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '4188d308699580d975efd0f6cca8dcb41c396f70')
Children:
639652f186091509059ccc76f18852db93c1b988
Parents:
6e2ef0e6c1f75468f4ae12cfb9e5273eb4aa81c1
Message:
- removed some unsed variables
- never put static inline routine without a body in a .h file



git-svn-id: file:///usr/local/Singular/svn/trunk@14265 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
factory
Files:
20 edited

Legend:

Unmodified
Added
Removed
  • factory/cfGEval.cc

    r6e2ef0e rc1b9927  
    1313        delete gen[i];
    1414      delete [] gen;
    15            
     15
    1616      gen= new CFGenerator* [e.values.max() - e.values.min() + 1];
    1717      for (int i= 0; i < e.values.max() - e.values.min() + 1; i++)
     
    2525  gen= new CFGenerator* [max0 - min0 + 1];
    2626  for (int i= 0; i < max0 - min0 + 1; i++)
    27     gen[i]= sample.clone(); 
     27    gen[i]= sample.clone();
    2828}
    2929
     
    6262}
    6363
    64 void 
     64void
    6565GEvaluation::reset()
    6666{
     
    7474}
    7575
    76 void 
     76void
    7777GEvaluation::init (int n)
    7878{
     79  #ifndef NOASSERT
    7980  int t= values.max();
     81  #endif
    8082  int u= values.min();
    8183  ASSERT (n <= t - u + 1, "wrong number of evaluation points");
     
    8789}
    8890
    89 bool 
     91bool
    9092GEvaluation::nextpoint (int n) // n= number of non zero components
    9193{
  • factory/cfNewtonPolygon.cc

    r6e2ef0e rc1b9927  
    33\*****************************************************************************/
    44/** @file cfNewtonPolygon.cc
    5  * 
     5 *
    66 * This file provides functions to compute the Newton polygon of a bivariate
    77 * polynomial
     
    4141  for (int i= 1; i < sizePoints; i++)
    4242  {
    43     if (points[i][0] < points[min][0] || 
     43    if (points[i][0] < points[min][0] ||
    4444        (points[i] [0] == points[min] [0] && points[i] [1] < points[min] [1]))
    4545      min= i;
     
    6363  if (area == 0)
    6464  {
    65     return (abs (point1[0]) + abs (point1[1]) > 
     65    return (abs (point1[0]) + abs (point1[1]) >
    6666            abs (point2[0]) + abs (point2[1]));
    6767  }
     
    300300    }
    301301  }
    302  
     302
    303303  if (buf [sizeBuf - 1] [0] == point [0] && buf [sizeBuf-1] [1] == point [1])
    304304  {
     
    487487  Variable x= Variable (1);
    488488  Variable y= Variable (2);
    489   int sizeF= size (F);
    490   int ** points= getPoints (F, sizeF);
    491489
    492490  ZZ minExpX, minExpY;
  • factory/cf_algorithm.cc

    r6e2ef0e rc1b9927  
    347347         && ((getCharacteristic() == 0 && isOn( SW_RATIONAL ))
    348348             || (getCharacteristic() > 0 && CFFactory::gettype() != PrimePowerDomain)) )
     349    {
    349350        // if we are in a field all elements not equal to zero are units
    350351        if ( f.inCoeffDomain() )
     
    353354            // g.inCoeffDomain()
    354355            return false;
     356    }
    355357
    356358    // we may assume now that both levels either equal LEVELBASE
  • factory/cf_cyclo.cc

    r6e2ef0e rc1b9927  
    3535  ASSERT (integer != 0 && integer != 1 && integer != -1,
    3636          "non-zero non-unit expected");
    37   int* result;
     37  int* result=NULL;
    3838  length= 0;
    3939  fail= false;
  • factory/cf_gcd.cc

    r6e2ef0e rc1b9927  
    13031303{
    13041304  CanonicalForm f, g, cg, cl, q(0), Dp, newD, D, newq;
    1305   int p, i, dp_deg, d_deg;
     1305  int p, i, dp_deg, d_deg=-1;
    13061306
    13071307  CanonicalForm cd ( bCommonDen( FF ));
  • factory/cf_gcd_smallp.cc

    r6e2ef0e rc1b9927  
    414414CanonicalForm uni_lcoeff (const CanonicalForm& F)
    415415{
    416   if (F.level() <= 1)
    417     return F;
    418   else
     416  if (F.level() > 1)
    419417  {
    420418    Variable x= Variable (2);
     
    426424    }
    427425  }
     426  return F;
    428427}
    429428
     
    900899  topLevel= false;
    901900  bool inextension= false;
    902   int p;
     901  int p=-1;
    903902  int k= getGFDegree();
    904903  int kk;
     
    18901889}
    18911890
    1892 CanonicalForm 
     1891CanonicalForm
    18931892monicSparseInterpol (const CanonicalForm& F, const CanonicalForm& G,
    18941893                     const CanonicalForm& skeleton, const Variable& alpha,
     
    19191918  ASSERT (degree (B, y) == 0, "expected degree (G, 1) == 0");
    19201919
    1921   //univariate case 
     1920  //univariate case
    19221921  if (A.isUnivariate() && B.isUnivariate())
    19231922    return N (gcd (A, B));
     
    20402039          evalFail= false;
    20412040          evalPoints= evaluationPoints (A, B, Aeval, Beval, LCA, GF, V_buf,
    2042                                         evalFail, list); 
     2041                                        evalFail, list);
    20432042          deg++;
    20442043        } while (evalFail);
     
    21812180  ASSERT (degree (B, y) == 0, "expected degree (G, 1) == 0");
    21822181
    2183   //univariate case 
     2182  //univariate case
    21842183  if (A.isUnivariate() && B.isUnivariate())
    21852184    return N (gcd (A, B));
     
    22832282            DEBOUTLN (cerr, "getMipo (alpha)= " << getMipo (V_buf2));
    22842283
    2285             for (CFListIterator i= list; i.hasItem(); i++) 
     2284            for (CFListIterator i= list; i.hasItem(); i++)
    22862285              i.getItem()= mapUp (i.getItem(), V_buf, V_buf2, prim_elem,
    22872286                                im_prim_elem, source, dest);
     
    23562355  else
    23572356    minimalColumnsIndex= 0;
    2358   int minimalColumns;
     2357  int minimalColumns=-1;
    23592358
    23602359  CFArray* pM= new CFArray [skelSize];
    23612360  CFMatrix Mat;
    2362   // find the Matrix with minimal number of columns 
     2361  // find the Matrix with minimal number of columns
    23632362  for (int i= 0; i < skelSize; i++)
    23642363  {
     
    23872386      if (i == 0)
    23882387        pL[k]= CFArray (biggestSize);
    2389       pL[k] [i]= l.coeff(); 
     2388      pL[k] [i]= l.coeff();
    23902389
    23912390      if (i == 0 && k != 0 && k != minimalColumnsIndex)
     
    24202419  int matRows, matColumns;
    24212420  matRows= pMat[1].rows();
    2422   matColumns= pMat[0].columns() - 1; 
     2421  matColumns= pMat[0].columns() - 1;
    24232422  matColumns += pMat[1].columns();
    24242423
     
    24282427      Mat (i, j)= pMat[1] (i, j);
    24292428
    2430   for (int j= pMat[1].columns() + 1; j <= matColumns; 
     2429  for (int j= pMat[1].columns() + 1; j <= matColumns;
    24312430       j++, ind++)
    24322431  {
    2433     for (int i= 1; i <= matRows; i++) 
     2432    for (int i= 1; i <= matRows; i++)
    24342433      Mat (i, j)= (-pMat [0] (i, ind + 1))*pL[minimalColumnsIndex] [i - 1];
    24352434  }
     
    24372436  CFArray firstColumn= CFArray (pMat[0].rows());
    24382437  for (int i= 0; i < pMat[0].rows(); i++)
    2439     firstColumn [i]= pMat[0] (i + 1, 1); 
     2438    firstColumn [i]= pMat[0] (i + 1, 1);
    24402439
    24412440  CFArray bufArray= pL[minimalColumnsIndex];
     
    24482447
    24492448  if (V_buf != x)
    2450     solution= solveSystemFq (pMat[1], 
     2449    solution= solveSystemFq (pMat[1],
    24512450                             pL[minimalColumnsIndex], V_buf);
    24522451  else
    2453     solution= solveSystemFp (pMat[1], 
     2452    solution= solveSystemFp (pMat[1],
    24542453                             pL[minimalColumnsIndex]);
    24552454
     
    24592458    delete [] pMat;
    24602459    pMat= new CFMatrix [skelSize];
    2461     pL[minimalColumnsIndex]= bufArray; 
     2460    pL[minimalColumnsIndex]= bufArray;
    24622461    CFList* bufpEvalPoints= NULL;
    24632462    CFArray bufGcds;
     
    25222521          continue;
    25232522        coeffEval= evaluate (coeffMonoms[k], evalPoints);
    2524         if (pMat[k].rows() >= i + 1) 
     2523        if (pMat[k].rows() >= i + 1)
    25252524        {
    25262525          for (int ind= 1; ind < coeffEval.size() + 1; ind++)
     
    25532552      for (int k= 0; k < skelSize; k++, l++)
    25542553      {
    2555         pL[k] [i + biggestSize]= l.coeff(); 
     2554        pL[k] [i + biggestSize]= l.coeff();
    25562555        coeffEval= evaluate (coeffMonoms[k], evalPoints);
    2557         if (pMat[k].rows() >= i + biggestSize + 1) 
    2558         { 
     2556        if (pMat[k].rows() >= i + biggestSize + 1)
     2557        {
    25592558          for (int ind= 1; ind < coeffEval.size() + 1; ind++)
    25602559            pMat[k] (i + biggestSize + 1, ind)= coeffEval[ind - 1];
     
    25672566      if (pL[i].size() > 1)
    25682567      {
    2569         for (int j= 2; j <= pMat[i].rows(); j++) 
    2570           pMat[i] (j, coeffMonoms[i].size() + j - 1)= 
     2568        for (int j= 2; j <= pMat[i].rows(); j++)
     2569          pMat[i] (j, coeffMonoms[i].size() + j - 1)=
    25712570              -pL[i] [j - 1];
    25722571      }
     
    26162615        if (j > coeffMonoms[i].size())
    26172616          bufArray [j-coeffMonoms[i].size() + ind - 1]= pL[i] [j - 1];
    2618         else 
     2617        else
    26192618          bufArray2 [j - 1]= pL[i] [j - 1];
    26202619      }
     
    26902689  {
    26912690    result += solution[l]*Monoms [1 + ind2];
    2692     for (int i= 0; i < pMat[0].rows(); i++) 
     2691    for (int i= 0; i < pMat[0].rows(); i++)
    26932692      firstColumn[i] += solution[l]*pMat[0] (i + 1, ind3);
    26942693  }
     
    27822781  Variable x= Variable (1);
    27832782
    2784   //univariate case 
     2783  //univariate case
    27852784  if (A.isUnivariate() && B.isUnivariate())
    27862785    return N (gcd (A, B));
     
    27982797    if (best_level <= 2)
    27992798      gcdcAcB= extractContents (A, B, cA, cB, ppA, ppB, best_level);
    2800     else 
    2801       gcdcAcB= extractContents (A, B, cA, cB, ppA, ppB, 2); 
     2799    else
     2800      gcdcAcB= extractContents (A, B, cA, cB, ppA, ppB, 2);
    28022801  }
    28032802  else
     
    28312830  int d0;
    28322831
    2833   if (d == 0) 
     2832  if (d == 0)
    28342833  {
    28352834    if (substitute > 1)
     
    28922891      DEBOUTLN (cerr, "getMipo (V_buf2)= " << getMipo (V_buf2));
    28932892      inextension= true;
    2894       for (CFListIterator i= l; i.hasItem(); i++) 
     2893      for (CFListIterator i= l; i.hasItem(); i++)
    28952894        i.getItem()= mapUp (i.getItem(), alpha, V_buf, prim_elem,
    28962895                             im_prim_elem, source, dest);
     
    29492948
    29502949    skeleton= G_random_element;
    2951     d0= totaldegree (G_random_element, Variable(2), 
     2950    d0= totaldegree (G_random_element, Variable(2),
    29522951                     Variable(G_random_element.level()));
    29532952    if (d0 <  d)
     
    30333032          DEBOUTLN (cerr, "getMipo (V_buf2)= " << getMipo (V_buf2));
    30343033          inextension= true;
    3035           for (CFListIterator i= l; i.hasItem(); i++) 
     3034          for (CFListIterator i= l; i.hasItem(); i++)
    30363035            i.getItem()= mapUp (i.getItem(), alpha, V_buf, prim_elem,
    30373036                                im_prim_elem, source, dest);
     
    30553054          bool sparseFail= false;
    30563055          if (LC (skeleton).inCoeffDomain())
    3057             G_random_element= 
     3056            G_random_element=
    30583057            monicSparseInterpol (ppA (random_element, x), ppB(random_element,x),
    30593058                                skeleton,V_buf, sparseFail, coeffMonoms,Monoms);
     
    30763075          bool sparseFail= false;
    30773076          if (LC (skeleton).inCoeffDomain())
    3078             G_random_element= 
     3077            G_random_element=
    30793078            monicSparseInterpol (ppA (random_element, x),ppB(random_element, x),
    30803079                                skeleton,V_buf, sparseFail,coeffMonoms, Monoms);
     
    30823081            G_random_element=
    30833082            nonMonicSparseInterpol (ppA(random_element,x),ppB(random_element,x),
    3084                                     skeleton, V_buf, sparseFail, coeffMonoms, 
     3083                                    skeleton, V_buf, sparseFail, coeffMonoms,
    30853084                                    Monoms);
    30863085          if (sparseFail)
     
    31963195  Variable x= Variable (1);
    31973196
    3198   //univariate case 
     3197  //univariate case
    31993198  if (A.isUnivariate() && B.isUnivariate())
    32003199    return N (gcd (A, B));
     
    32713270  H= 0;
    32723271  bool fail= false;
    3273   bool topLevel2= topLevel;
    3274   int loops= 0;
    32753272  topLevel= false;
    32763273  bool inextension= false;
     
    33273324        inextension= true;
    33283325        fail= false;
    3329         random_element= randomElement (m, alpha, l, fail); 
     3326        random_element= randomElement (m, alpha, l, fail);
    33303327        deg++;
    33313328      } while (fail);
     
    33953392      else
    33963393        return N(gcdcAcB);
    3397     } 
     3394    }
    33983395    if (d0 >  d)
    33993396    {
     
    35063503          CanonicalForm mipo;
    35073504          int deg= 2;
    3508           do 
     3505          do
    35093506          {
    35103507            mipo= randomIrredpoly (deg, x);
     
    36703667  int f_zero= 0;
    36713668  int g_zero= 0;
    3672   int both_zero= 0;
    36733669
    36743670  for (int i= 1; i <= n; i++)
     
    41034099      xxx2 = gcd( buf, Db );
    41044100      if (((xxx1.inCoeffDomain() && xxx2.inCoeffDomain()) &&
    4105           (size (F) <= size (G))) 
     4101          (size (F) <= size (G)))
    41064102          || (xxx1.inCoeffDomain() && !xxx2.inCoeffDomain()))
    41074103      {
     
    41134109      }
    41144110      else if (((xxx1.inCoeffDomain() && xxx2.inCoeffDomain()) &&
    4115                (size (G) < size (F))) 
     4111               (size (G) < size (F)))
    41164112               || (!xxx1.inCoeffDomain() && xxx2.inCoeffDomain()))
    41174113      {
  • factory/cf_map_ext.cc

    r6e2ef0e rc1b9927  
    5353{
    5454  int j= 1;
    55   if (pos > list.length() || pos < 1) return 0;
    56   for (CFListIterator i= list; j <= pos; i++, j++)
    57   {
    58     if (j == pos)
    59       return i.getItem();
    60   }
     55  if ((pos > 0) && (pos <= list.length()))
     56  {
     57    for (CFListIterator i= list; j <= pos; i++, j++)
     58    {
     59      if (j == pos)
     60        return i.getItem();
     61    }
     62  }
     63  return 0;
    6164}
    6265
     
    140143  int exp;
    141144  CanonicalForm result= 0;
    142   char gf_name_buf= gf_name;
    143145  InternalCF* buf;
    144146  if (F.inBaseDomain())
     
    376378    int p= getCharacteristic ();
    377379    zz_p::init (p);
    378     zz_pX NTLMipo= convertFacCF2NTLzzpX (getMipo (beta)); 
     380    zz_pX NTLMipo= convertFacCF2NTLzzpX (getMipo (beta));
    379381    zz_pE::init (NTLMipo);
    380382    zz_pEX NTLPrimElemMipo= convertFacCF2NTLzz_pEX (primElemMipo, NTLMipo);
     
    397399  int p= getCharacteristic ();
    398400  zz_p::init (p);
    399   zz_pX NTL_mipo= convertFacCF2NTLzzpX (getMipo (beta)); 
     401  zz_pX NTL_mipo= convertFacCF2NTLzzpX (getMipo (beta));
    400402  zz_pE::init (NTL_mipo);
    401403  zz_pEX NTL_alpha_mipo= convertFacCF2NTLzz_pEX (getMipo(alpha), NTL_mipo);
    402404  zz_pE NTLBeta= to_zz_pE (convertFacCF2NTLzzpX (beta));
    403405  vec_zz_pE roots= FindRoots (NTL_alpha_mipo);
    404   long ind;
     406  long ind=-1;
    405407  for (long i= 0; i < roots.length(); i++)
    406408  {
  • factory/cf_util.cc

    r6e2ef0e rc1b9927  
    5353void factoryError_intern(const char *s)
    5454{
    55   fprintf(stderr,s);
     55  fputs(s,stderr);
    5656  abort();
    5757}
  • factory/debug.cc

    r6e2ef0e rc1b9927  
    33
    44static int deb_level = -1;
    5 char * deb_level_msg = "";
     5char * deb_level_msg = (char *)"";
    66
    77void deb_inc_level()
  • factory/facFqBivar.cc

    r6e2ef0e rc1b9927  
    793793  CanonicalForm gamma= info.getGamma();
    794794  CanonicalForm delta= info.getDelta();
    795   int k= info.getGFDegree();
    796795  bool extension= info.isInExtension();
    797796
     
    900899    {
    901900      if (!IsZero (M (i,j)))
    902         nonZero++; 
     901        nonZero++;
    903902    }
    904903    if (nonZero != 1)
     
    10181017{
    10191018  Variable y= Variable (2);
    1020   Variable x= Variable (1); 
     1019  Variable x= Variable (1);
    10211020  CanonicalForm yToL= power (y, liftBound);
    10221021  for (long i= 1; i <= N.NumCols(); i++)
     
    12191218    {
    12201219      CFList source, dest;
    1221      
     1220
    12221221      if (!isInExtension (buf2, gamma, k, delta, source, dest))
    12231222      {
     
    12921291
    12931292void
    1294 extReconstructionTry (CFList& reconstructedFactors, CanonicalForm& F, const 
     1293extReconstructionTry (CFList& reconstructedFactors, CanonicalForm& F, const
    12951294                      CFList& factors, const int liftBound, int& factorsFound,
    12961295                      int*& factorsFoundIndex, mat_zz_p& N, bool beenInThres,
     
    16641663                      )
    16651664{
    1666   bool GF= (CFFactory::gettype () == GaloisFieldDomain);
    16671665  CanonicalForm LCF= LC (F, 1);
    16681666  CFArray *A= new CFArray [factors.length() - 1];
     
    17741772                           )
    17751773{
    1776   bool GF= (CFFactory::gettype () == GaloisFieldDomain);
    17771774  CanonicalForm LCF= LC (F, 1);
    17781775  CFArray *A= new CFArray [factors.length() - 1];
     
    19511948      if (isReduced (NTLN))
    19521949      {
    1953         int d= degree (F) + 1;
    19541950        int * factorsFoundIndex= new int [NTLN.NumCols()];
    19551951        for (long i= 0; i < NTLN.NumCols(); i++)
     
    20752071      if (isReduced (NTLN))
    20762072      {
    2077         int d= degree (F) + 1;
    20782073        int * factorsFoundIndex= new int [NTLN.NumCols()];
    20792074        for (long i= 0; i < NTLN.NumCols(); i++)
     
    22632258      if (isReduced (NTLN))
    22642259      {
    2265       int d= degree (F) + 1;
    22662260      int * factorsFoundIndex= new int [NTLN.NumCols()];
    22672261      for (long i= 0; i < NTLN.NumCols(); i++)
     
    25052499      if (isReduced (NTLN))
    25062500      {
    2507         int d= degree (F) + 1;
    25082501        int * factorsFoundIndex= new int [NTLN.NumCols()];
    25092502        for (long i= 0; i < NTLN.NumCols(); i++)
     
    26292622    if (degree (bufF) + 1 + degree (LC (bufF, 1)) < oldL && result.length() > 0)
    26302623    {
    2631       F= bufF; 
     2624      F= bufF;
    26322625      factors= bufUniFactors;
    26332626      delete [] A;
     
    27252718    if (degree (bufF) + 1 + degree (LC (bufF, 1)) < l && result.length() > 0)
    27262719    {
    2727       F= bufF; 
     2720      F= bufF;
    27282721      factors= bufUniFactors;
    27292722      delete [] A;
     
    27702763  CanonicalForm primElemAlpha= info.getGamma();
    27712764  CanonicalForm imPrimElemAlpha= info.getDelta();
    2772   bool reduced= false;
    27732765  if (NTLN.NumRows() != factors.length()) //refined factors
    27742766    ident (NTLN, factors.length());
     
    27872779      imBasis= imBasis (power (y, degMipo), y);
    27882780      imBasis= imBasis (y, gamma);
    2789       int ind= oldL*degMipo - 1;
    27902781      CFIterator iter= imBasis;
    27912782      for (; iter.hasTerms(); iter++)
     
    28012792    {
    28022793      for (int i= 0; i < factors.length(); i++, j++)
    2803         A[i]= logarithmicDerivative (F, j.getItem(), oldL, oldL2, bufQ[i], 
     2794        A[i]= logarithmicDerivative (F, j.getItem(), oldL, oldL2, bufQ[i],
    28042795                                     bufQ[i]);
    28052796    }
     
    28942885    if (degree (bufF) + 1 + degree (LC (bufF, 1)) < l && result.length() > 0)
    28952886    {
    2896       F= bufF; 
     2887      F= bufF;
    28972888      factors= bufUniFactors;
    28982889      return result;
     
    30133004    if (degree (bufF) + 1 + degree (LC (bufF, 1)) < l && result.length() > 0)
    30143005    {
    3015       F= bufF; 
     3006      F= bufF;
    30163007      factors= bufUniFactors;
    30173008      delete [] A;
     
    33203311  int stepSize= 8;
    33213312  l += tmax (tmin (8, degree (F) + 1 + degree (LC (F, 1))-l),2);
    3322   bool reduced= false;
    33233313  Variable gamma= info.getBeta();
    33243314  CanonicalForm primElemAlpha= info.getGamma();
     
    35123502  int stepSize= 8; //TODO choose better step size?
    35133503  l += tmax (tmin (8, degree (F) + 1 + degree (LC (F, 1))-l), 2);
    3514   bool reduced= false;
    35153504  if (NTLN.NumRows() != factors.length()) //refined factors
    35163505    ident (NTLN, factors.length());
     
    36603649  Variable y= Variable (2);
    36613650  CanonicalForm LCF= LC (F, 1);
    3662   for (long i= 1; i <= NTLN.NumCols(); i++) 
     3651  for (long i= 1; i <= NTLN.NumCols(); i++)
    36633652  {
    36643653    CFListIterator iter= factors;
     
    38893878
    38903879CFList
    3891 sieveSmallFactors (const CanonicalForm& G, CFList& uniFactors, DegreePattern& 
     3880sieveSmallFactors (const CanonicalForm& G, CFList& uniFactors, DegreePattern&
    38923881                   degPat, CanonicalForm& H, CFList& diophant, CFArray& Pi,
    38933882                   CFMatrix& M, bool& success, int d
     
    39163905  }
    39173906  int sizeOldF= size (F);
    3918   int sizeF;
    39193907  CFList result;
    39203908  CanonicalForm bufF= F;
     
    39703958  CanonicalForm shiftedF= F (y - evaluation, y);
    39713959  int sizeOldF= size (shiftedF);
    3972   int sizeF;
    39733960  CFList result;
    39743961  CanonicalForm bufF= shiftedF;
     
    41204107      ident (NTLNe, bufUniFactors.length() - 1);
    41214108  }
    4122   bool wasInBounds= false;
    41234109  bool irreducible= false;
    41244110  CFArray bufQ= CFArray (bufUniFactors.length() - 1);
     
    42434229    if (alpha.level() == 1 || (alpha.level() != 1 && reduceFq2Fp))
    42444230    {
    4245       factorsFoundIndex= new int [NTLN.NumCols()]; 
     4231      factorsFoundIndex= new int [NTLN.NumCols()];
    42464232      for (long i= 0; i < NTLN.NumCols(); i++)
    42474233        factorsFoundIndex[i]= 0;
     
    42494235    else
    42504236    {
    4251       factorsFoundIndex= new int [NTLNe.NumCols()]; 
     4237      factorsFoundIndex= new int [NTLNe.NumCols()];
    42524238      for (long i= 0; i < NTLNe.NumCols(); i++)
    42534239        factorsFoundIndex[i]= 0;
     
    42934279      if (NTLN.NumCols() < bufUniFactors.length())
    42944280      {
    4295         refineAndRestartLift (F, NTLN, liftBound, l, bufUniFactors, M, Pi, 
     4281        refineAndRestartLift (F, NTLN, liftBound, l, bufUniFactors, M, Pi,
    42964282                              diophant
    42974283                             );
     
    44824468    if (alpha.level() == 1 || (alpha.level() != 1 && reduceFq2Fp))
    44834469    {
    4484       if (result.length()== NTLN.NumCols()) 
     4470      if (result.length()== NTLN.NumCols())
    44854471      {
    44864472        delete [] bounds;
     
    44914477    else
    44924478    {
    4493       if (result.length()== NTLNe.NumCols()) 
     4479      if (result.length()== NTLNe.NumCols())
    44944480      {
    44954481        delete [] bounds;
     
    45244510      if (alpha.level() == 1 || (alpha.level() != 1 && reduceFq2Fp))
    45254511      {
    4526         if (result.length() == NTLN.NumCols()) 
     4512        if (result.length() == NTLN.NumCols())
    45274513        {
    45284514          delete [] bounds;
     
    45334519      else
    45344520      {
    4535         if (result.length() == NTLNe.NumCols()) 
     4521        if (result.length() == NTLNe.NumCols())
    45364522        {
    45374523          delete [] bounds;
     
    46404626                              )
    46414627{
    4642   bool GF= (CFFactory::gettype()==GaloisFieldDomain);
    46434628  CanonicalForm evaluation= eval;
    46444629  ExtensionInfo info= extInfo;
     
    47664751
    47674752  ident (NTLN, bufUniFactors.length() - 1);
    4768   bool wasInBounds= false;
    47694753  bool irreducible= false;
    47704754  CFArray bufQ= CFArray (bufUniFactors.length() - 1);
     
    48414825  {
    48424826    int * factorsFoundIndex;
    4843       factorsFoundIndex= new int [NTLN.NumCols()]; 
     4827      factorsFoundIndex= new int [NTLN.NumCols()];
    48444828      for (long i= 0; i < NTLN.NumCols(); i++)
    48454829        factorsFoundIndex[i]= 0;
     
    49894973                                );
    49904974
    4991     if (result.length()== NTLN.NumCols()) 
     4975    if (result.length()== NTLN.NumCols())
    49924976    {
    49934977      delete [] bounds;
     
    50044988                                                     dest
    50054989                                                    );
    5006       if (result.length()== NTLN.NumCols()) 
     4990      if (result.length()== NTLN.NumCols())
    50074991      {
    50084992        delete [] bounds;
     
    54155399    CFList earlyFactors;
    54165400    TIMING_START (fac_hensel_lift);
    5417     uniFactors= henselLiftAndEarly 
     5401    uniFactors= henselLiftAndEarly
    54185402               (A, earlySuccess, earlyFactors, degs, liftBound,
    54195403                uniFactors, info, evaluation);
  • factory/facFqBivar.h

    r6e2ef0e rc1b9927  
    208208{
    209209  ExtensionInfo info= ExtensionInfo (false);
    210   bool GF= false;
    211210  CFMap N;
    212211  CanonicalForm F= compress (G, N);
     
    290289{
    291290  ExtensionInfo info= ExtensionInfo (alpha, false);
    292   bool GF= false;
    293291  CFMap N;
    294292  CanonicalForm F= compress (G, N);
     
    375373          "GF as base field expected");
    376374  ExtensionInfo info= ExtensionInfo (getGFDegree(), gf_name, false);
    377   bool GF= true;
    378375  CFMap N;
    379376  CanonicalForm F= compress (G, N);
     
    491488inline CFList
    492489extFactorRecombination (
    493          CFList& factors,          ///< [in,out] list of lifted factors that are 
     490         CFList& factors,          ///< [in,out] list of lifted factors that are
    494491                                   ///< monic wrt Variable (1),
    495492                                   ///< original factors-factors found
     
    497494                                   ///< F/factors found
    498495         const CanonicalForm& M,   ///< [in] Variable (2)^liftBound
    499          const ExtensionInfo& info,///< [in] contains information about 
     496         const ExtensionInfo& info,///< [in] contains information about
    500497                                   ///< extension
    501498         DegreePattern& degs,
     
    505502         int thres                 ///< [in] threshold for the size of subsets
    506503                                   ///< which are checked, for a full factor
    507                                    ///< recombination choose 
     504                                   ///< recombination choose
    508505                                   ///< thres= factors.length()/2
    509506                       );
     
    525522                int thres              ///< [in] threshold for the size of
    526523                                       ///< subsets which are checked, for a
    527                                        ///< full factor recombination choose 
     524                                       ///< full factor recombination choose
    528525                                       ///< thres= factors.length()/2
    529526                    );
  • factory/facFqBivarUtil.cc

    r6e2ef0e rc1b9927  
    198198  else if (k == 1)
    199199    return F;
    200   else if (!k && beta == Variable (1))
     200  if (/*k==0 &&*/ beta == Variable (1))
    201201    return F;
    202   else if (!k && beta != Variable (1))
     202  else /*if (k==0 && beta != Variable (1))*/
    203203    return mapDown (F, imPrimElem, primElem, beta, source, dest);
    204204}
     
    276276void normalize (CFFList& factors)
    277277{
    278   for (CFFListIterator i= factors; i.hasItem(); i++) 
     278  for (CFFListIterator i= factors; i.hasItem(); i++)
    279279    i.getItem()= CFFactor (i.getItem().factor()/Lc(i.getItem().factor()),
    280280                           i.getItem().exp());
     
    543543    {
    544544      result [i - k]= j.coeff();
    545       j++; 
     545      j++;
    546546      if (!j.hasTerms())
    547547        return result;
     
    611611  NTLF.normalize();
    612612  F= convertNTLzzpX2CF (NTLF, y);
    613   int d= degMipo;
    614613
    615614  if (degree (F, 2) < k)
     
    624623    {
    625624      result [i - k]= j.coeff();
    626       j++; 
     625      j++;
    627626      if (!j.hasTerms())
    628627        return result;
     
    673672
    674673  int k= maxX;
    675   bool hitMaxX= false;
    676674  for (int i= 0; i < n; i++)
    677675  {
  • factory/facFqFactorize.cc

    r6e2ef0e rc1b9927  
    9898  CFList L;
    9999  Variable alpha;
    100   bool algExt= hasFirstAlgVar (G, alpha);
    101100  for (CFIterator i= G; i.hasTerms(); i++)
    102101    L.append (i.coeff());
     
    643642  bool noSubset= false;
    644643  CFArray TT;
    645   int subsetDeg;
    646644  TT= copy (factors);
    647645  bool recombination= false;
     
    770768  bool noSubset= false;
    771769  CFArray TT;
    772   int subsetDeg;
    773770  TT= copy (factors);
    774771  Variable y= F.level() - 1;
     
    13051302  int smallFactorDeg= 11; //tunable parameter
    13061303  CFList result;
    1307   int newLiftBound= 0;
    13081304  int adaptedLiftBound= 0;
    13091305  int liftBound= liftBounds[1];
    13101306
    13111307  earlySuccess= false;
    1312   bool earlyReconst= false;
    13131308  CFList earlyReconstFactors;
    13141309  CFListIterator j= Aeval;
     
    15941589  CanonicalForm gamma= info.getGamma();
    15951590  CanonicalForm delta= info.getDelta();
    1596   int k= info.getGFDegree();
    15971591  bool extension= info.isInExtension();
    15981592  bool GF= (CFFactory::gettype() == GaloisFieldDomain);
     
    18011795
    18021796  int* liftBounds;
    1803   int liftBoundsLength= F.level() - 1;
    18041797  liftBounds= liftingBounds (A, lift);
    18051798
  • factory/facFqFactorize.h

    r6e2ef0e rc1b9927  
    232232  return result;
    233233}
    234 
    235 /// compute the content of @a F wrt Variable (1) using routines from
    236 /// @a cf_gcd_smallp.h
    237 ///
    238 /// @return @a myContent returns the content of F wrt Variable (1)
    239 static inline
    240 CanonicalForm
    241 myContent (const CanonicalForm& F ///< [in] a poly
    242           );
    243 
    244 /// compute the content of @a F wrt @a x using routines from
    245 /// @a cf_gcd_smallp.h
    246 ///
    247 /// @return @a myContent returns the content of F wrt x
    248 static inline
    249 CanonicalForm
    250 myContent (const CanonicalForm& F, ///< [in] a poly
    251            const Variable& x       ///< [in] a variable
    252           );
    253 
    254 /// compute the GCD of all element in @a L using routines from
    255 /// @a cf_gcd_smallp.h
    256 ///
    257 /// @return @a listGCD returns the GCD of all elements in @a L
    258 static inline
    259 CanonicalForm
    260 listGCD (const CFList& L ///< [in] a list of polys
    261         );
    262 
    263 /// compute the LCM of @a F and @a G using routines from
    264 /// @a cf_gcd_smallp.h
    265 ///
    266 /// @return @a myLcm returns the LCM of @a F and @a G
    267 static inline
    268 CanonicalForm
    269 myLcm (const CanonicalForm& F,   ///< [in] a poly
    270        const CanonicalForm& G    ///< [in] a poly
    271       );
    272 
    273 /// compute the LCM of the contents of @a A wrt to each variable occuring in @a
    274 /// A.
    275 ///
    276 /// @return @a lcmContent returns the LCM of the contents of @a A wrt to each
    277 ///         variable occuring in @a A.
    278 static inline
    279 CanonicalForm
    280 lcmContent (const CanonicalForm& A, ///< [in] a compressed multivariate poly
    281             CFList& contentAi       ///< [in,out] an empty list, returns a list
    282                                     ///< of the contents of @a A wrt to each
    283                                     ///< variable occuring in @a A starting from
    284                                     ///< @a A.mvar().
    285            );
    286 
    287 /// compress a polynomial s.t. \f$ deg_{x_{i}} (F) >= deg_{x_{i+1}} (F) \f$ and
    288 /// no gaps between the variables occur
    289 ///
    290 /// @return a compressed poly with the above properties
    291 static inline
    292 CanonicalForm myCompress (const CanonicalForm& F, ///< [in] a poly
    293                           CFMap& N                ///< [in,out] a map to
    294                                                   ///< decompress
    295                          );
    296234
    297235/// naive factor recombination for bivariate factorization.
     
    489427           );
    490428
    491 /// looks for a new main variable of level higher than lev which omitts a valid
    492 /// evaluation, and returns its level. If there is no such variable 0 is
    493 /// returned
    494 ///
    495 /// @return @a newMainVariableSearch returns the level of the new main variable,
    496 ///         if there no variable which omitts a valid evaluation 0 is returned
    497 static inline
    498 int newMainVariableSearch (
    499               CanonicalForm& A,     ///< [in,out] a compressed poly, returns
    500                                     ///< the swapped initial poly or the
    501                                     ///< initial poly if 0 is returned
    502               CFList& Aeval,        ///< [in,out] @a A successively evaluated,
    503                                     ///< empty list if 0 is returned
    504               CFList& evaluation,   ///< [in,out] evaluation point, empty list
    505                                     ///< if 0 is returned
    506               const Variable& alpha,///< [in] algebraic variable
    507               const int lev         ///< [in] some int <= A.level()
    508                           );
    509429/// hensel Lifting and early factor detection
    510430///
  • factory/facFqSquarefree.h

    r6e2ef0e rc1b9927  
    7575}
    7676
    77 /// squarefree factorization of @a F wrt @x
    78 ///
    79 /// @return a list of factors of @a F which are squarefree wrt x
    80 static inline
    81 CFFList
    82 sqrfPosDer (const CanonicalForm & F, ///< [in] some poly
    83             const Variable & x,      ///< [in] a variable s.t. deriv (F, x) != 0
    84             const int & k,           ///< [in] GFDegree or 1
    85             const Variable & alpha,  ///< [in] algebraic variable or Variable(1)
    86             CanonicalForm & c        ///< [in,out] F divided by the product of
    87                                      ///< the result
    88            );
    89 
    9077/// squarefree part of @a F/g, where g is the product of those squarefree
    9178/// factors whose multiplicity is 0 mod p, if @a F a pth power pthPower= F.
     
    9986          const Variable& alpha    ///< [in] algebraic variable
    10087         );
    101 
    102 /// pth root extraction
    103 ///
    104 /// @return @a pthRoot returns a pth root of @a F
    105 /// @sa maxpthRoot()
    106 static inline
    107 CanonicalForm
    108 pthRoot (const CanonicalForm & F, ///< [in] a poly which is a pth power
    109          const int & q            ///< [in] size of the field
    110         );
    11188
    11289/// p^l-th root extraction, where l is maximal
  • factory/facHensel.cc

    r6e2ef0e rc1b9927  
    372372  int repLengthBuf2;
    373373  int repLengthBuf1;
    374   int ii;
    375374  zz_pE zzpEZero= zz_pE();
    376375
     
    488487  int repLengthBuf2;
    489488  int repLengthBuf1;
    490   int ii;
    491489  zz_p zzpZero= zz_p();
    492490  while (degf >= lf || lg >= 0)
     
    506504
    507505    repLengthBuf1= buf1.rep.length();
    508    
     506
    509507    if (deggSubLg >= d - 1)
    510508      repLengthBuf2= d - 1;
     
    648646// assumes input to be reduced mod M and to be an element of Fq not Fp
    649647CanonicalForm
    650 mulMod2NTLFpReci (const CanonicalForm& F, const CanonicalForm& G, const 
     648mulMod2NTLFpReci (const CanonicalForm& F, const CanonicalForm& G, const
    651649                  CanonicalForm& M)
    652650{
     
    675673  CanonicalForm A= F;
    676674  CanonicalForm B= G;
    677 
    678   int p= getCharacteristic();
    679675
    680676  int degAx= degree (A, 1);
     
    701697// assumes input to be reduced mod M and to be an element of Fq not Fp
    702698CanonicalForm
    703 mulMod2NTLFqReci (const CanonicalForm& F, const CanonicalForm& G, const 
     699mulMod2NTLFqReci (const CanonicalForm& F, const CanonicalForm& G, const
    704700                  CanonicalForm& M, const Variable& alpha)
    705701{
     
    779775  int degG= degree (G, y);
    780776
    781   if ((degF < 1 && degG < 1) && (F.isUnivariate() && G.isUnivariate()) && 
     777  if ((degF < 1 && degG < 1) && (F.isUnivariate() && G.isUnivariate()) &&
    782778      (F.level() == G.level()))
    783   { 
     779  {
    784780    CanonicalForm result= mulNTL (F, G);
    785781    return mod (result, M);
    786782  }
    787783  else if (degF <= 1 && degG <= 1)
    788   { 
     784  {
    789785    CanonicalForm result= F*G;
    790786    return mod (result, M);
     
    793789  int sizeF= size (F);
    794790  int sizeG= size (G);
    795  
     791
    796792  int fallBackToNaive= 50;
    797793  if (sizeF < fallBackToNaive || sizeG < fallBackToNaive)
     
    16481644        if (k != j - k + 1)
    16491645        {
    1650           if ((one.hasTerms() && one.exp() == j - k + 1) && 
     1646          if ((one.hasTerms() && one.exp() == j - k + 1) &&
    16511647              (two.hasTerms() && two.exp() == j - k + 1))
    16521648          {
     
    16941690  if (j.hasItem())
    16951691    j++;
    1696   for (j; j.hasItem(); j++, i++)
     1692  for (; j.hasItem(); j++, i++)
    16971693  {
    16981694    Pi [i]= mulNTL (Pi [i - 1], j.getItem());
     
    20552051      if (k != j - k + 1)
    20562052      {
    2057         if ((one.hasTerms() && one.exp() == j - k + 1) && 
     2053        if ((one.hasTerms() && one.exp() == j - k + 1) &&
    20582054            (two.hasTerms() && two.exp() == j - k + 1))
    20592055        {
     
    21412137        if (k != j - k + 1)
    21422138        {
    2143           if ((one.hasTerms() && one.exp() == j - k + 1) && 
     2139          if ((one.hasTerms() && one.exp() == j - k + 1) &&
    21442140              (two.hasTerms() && two.exp() == j - k + 1))
    21452141          {
     
    21792175  CFList buf= factors;
    21802176  int k= 0;
    2181   int liftBound;
    21822177  int liftBoundBivar= l[k];
    21832178  diophant= biDiophantine (eval.getFirst(), buf, liftBoundBivar);
     
    22012196  if (i.hasItem())
    22022197    i++;
    2203   for (i; i.hasItem(); i++, k++)
     2198  for (; i.hasItem(); i++, k++)
    22042199  {
    22052200    Pi [k]= mulMod (Pi [k - 1], i.getItem(), MOD);
     
    22682263  if (i.hasItem())
    22692264    i++;
    2270   for (i; i.hasItem(); i++, k++)
     2265  for (; i.hasItem(); i++, k++)
    22712266  {
    22722267    Pi [k]= mod (Pi [k], xToLOld);
     
    23472342      buf[k]= modNTL (buf[k], bufFactors[k] [0]);
    23482343    else
    2349       buf[k]= modNTL (buf[k], bufFactors[k]); 
     2344      buf[k]= modNTL (buf[k], bufFactors[k]);
    23502345  }
    23512346
     
    24992494}
    25002495
    2501 /// solve \f$ E=sum_{i= 1}^{r}{\sigma_{i}prod_{j=1, j\neq i}^{r}{f_{i}}}\f$ 
     2496/// solve \f$ E=sum_{i= 1}^{r}{\sigma_{i}prod_{j=1, j\neq i}^{r}{f_{i}}}\f$
    25022497/// mod M, products contains \f$ prod_{j=1, j\neq i}^{r}{f_{i}}} \f$
    25032498static inline
    25042499CFList
    2505 diophantine (const CFList& recResult, const CFList& factors, 
     2500diophantine (const CFList& recResult, const CFList& factors,
    25062501             const CFList& products, const CFList& M, const CanonicalForm& E,
    25072502             bool& bad)
     
    26472642  else
    26482643    uIZeroJ= 0;
    2649   Pi [0] += xToJ*uIZeroJ; 
     2644  Pi [0] += xToJ*uIZeroJ;
    26502645
    26512646  CFArray tmp= CFArray (factors.length() - 1);
     
    26632658      if (k != j - k + 1)
    26642659      {
    2665         if ((one.hasTerms() && one.exp() == j - k + 1) && 
     2660        if ((one.hasTerms() && one.exp() == j - k + 1) &&
    26662661            (two.hasTerms() && two.exp() == j - k + 1))
    26672662        {
     
    27682763          else if (two.hasTerms() && two.exp() == j - k + 1)
    27692764          {
    2770             tmp[l] += mulMod (bufFactors[l + 1] [k], 
     2765            tmp[l] += mulMod (bufFactors[l + 1] [k],
    27712766                      (Pi[l - 1] [k] + two.coeff()), MOD) - M (k + 1, l + 1);
    27722767            two++;
     
    28982893
    28992894  if (degree (bufFactors[0], y) > 0 && degree (bufFactors [1], y) > 0)
    2900     Pi [0] += (mulMod (bufFactors [0] [1], bufFactors[1] [0], MOD) + 
     2895    Pi [0] += (mulMod (bufFactors [0] [1], bufFactors[1] [0], MOD) +
    29012896                        mulMod (bufFactors [0] [0], bufFactors [1] [1], MOD))*y;
    29022897  else if (degree (bufFactors[0], y) > 0)
     
    29942989
    29952990CFList
    2996 nonMonicHenselLift23 (const CanonicalForm& F, const CFList& factors, const 
     2991nonMonicHenselLift23 (const CanonicalForm& F, const CFList& factors, const
    29972992                      CFList& LCs, CFList& diophant, CFArray& Pi, int liftBound,
    29982993                      int bivarLiftBound, bool& bad)
     
    30263021  {
    30273022    M (1, 1)= mulMod2 (bufFactors [0] [0], bufFactors[1] [0], yToL);
    3028     Pi [0]= M (1,1) + (mulMod2 (bufFactors [0] [1], bufFactors[1] [0], yToL) + 
     3023    Pi [0]= M (1,1) + (mulMod2 (bufFactors [0] [1], bufFactors[1] [0], yToL) +
    30293024                       mulMod2 (bufFactors [0] [0], bufFactors [1] [1], yToL))*v;
    30303025  }
     
    30503045    {
    30513046      M (1,i+1)= mulMod2 (Pi[i-1] [0], bufFactors[i+1] [0], yToL);
    3052       Pi [i]= M (1,i+1) + (mulMod2 (Pi[i-1] [1], bufFactors[i+1] [0], yToL) + 
     3047      Pi [i]= M (1,i+1) + (mulMod2 (Pi[i-1] [1], bufFactors[i+1] [0], yToL) +
    30533048                       mulMod2 (Pi[i-1] [0], bufFactors [i+1] [1], yToL))*v;
    30543049    }
     
    31113106
    31123107  if (degree (bufFactors[0], y) > 0 && degree (bufFactors [1], y) > 0)
    3113     Pi [0] += (mulMod (bufFactors [0] [1], bufFactors[1] [0], MOD) + 
     3108    Pi [0] += (mulMod (bufFactors [0] [1], bufFactors[1] [0], MOD) +
    31143109                        mulMod (bufFactors [0] [0], bufFactors [1] [1], MOD))*y;
    31153110  else if (degree (bufFactors[0], y) > 0)
  • factory/facHensel.h

    r6e2ef0e rc1b9927  
    6464           CanonicalForm& R        ///< [in,out] remainder
    6565          );*/
    66 
    67 /// splits @a F into degree (F, x)/m polynomials each of degree less than @a m
    68 /// in @a x.
    69 ///
    70 /// @return @a split returns a list of polynomials of degree less than @a m in
    71 ///         @a x. If degree (F, x) <= 0, F is returned.
    72 /// @sa divrem32(), divrem21()
    73 static inline
    74 CFList split (const CanonicalForm& F, ///< [in] some poly
    75               const int m,            ///< [in] some int
    76               const Variable& x       ///< [in] some Variable
    77              );
    78 
    79 /// division with remainder of @a F by
    80 /// @a G wrt Variable (1) modulo @a M.
    81 ///
    82 /// @sa divrem(), divrem21(), divrem2()
    83 static inline
    84 void divrem32 (const CanonicalForm& F, ///< [in] poly, s.t. 3*(degree (G, 1)/2)>
    85                                        ///< degree (F, 1)
    86                const CanonicalForm& G, ///< [in] some poly
    87                CanonicalForm& Q,       ///< [in,out] dividend
    88                CanonicalForm& R,       ///< [in,out] remainder, degree (R, 1) <
    89                                        ///< degree (G, 1)
    90                const CFList& M         ///< [in] only contains powers of
    91                                        ///< Variables of level higher than 1
    92               );
    93 
    94 /// division with remainder of @a F by
    95 /// @a G wrt Variable (1) modulo @a M.
    96 ///
    97 /// @sa divrem(), divrem32(), divrem2()
    98 static inline
    99 void divrem21 (const CanonicalForm& F, ///< [in] poly, s.t. 2*degree (G, 1) >
    100                                        ///< degree (F, 1)
    101                const CanonicalForm& G, ///< [in] some poly
    102                CanonicalForm& Q,       ///< [in,out] dividend
    103                CanonicalForm& R,       ///< [in,out] remainder, degree (R, 1) <
    104                                        ///< degree (G, 1)
    105                const CFList& M         ///< [in] only contains powers of
    106                                        ///< Variables of level higher than 1
    107               );
    10866
    10967/// division with remainder of @a F by
     
    212170               const Variable& x ///< [in] some Variable
    213171              );
    214 
    215 /// solve the univariate diophantine equation
    216 /// \f$ 1\equiv \sum_{i= 1}^{r} {\delta_{i} F/g_{i}} \f$.
    217 /// Where \f$ F= \prod_{i= 1}^{r} {g_{i}} \f$ and \f$ F \f$ is squarefree
    218 /// the \f$ \delta_{i} \f$ have degree less than the degree of \f$ g_{i} \f$.
    219 ///
    220 /// @return @a diophantine returns a list of polynomials \f$ \delta_{i} \f$ as
    221 /// specified above
    222 /// @sa biDiophantine(), multiRecDiophantine()
    223 static inline
    224 CFList diophantine (const CanonicalForm& F, ///< [in] compressed, bivariate
    225                                             ///< polynomial
    226                     const CFList& factors   ///< [in] a list of factors, as
    227                                             ///< specified above, including
    228                                             ///< LC (F, Variable (1)) as first
    229                                             ///< element
    230                    );
    231172
    232173/// Hensel lift from univariate to bivariate.
     
    268209                                            ///< results
    269210                   );
    270 
    271 /// solves the bivariate polynomial diophantine equation
    272 /// \f$ 1\equiv \sum_{i= 1}^{r} {\delta_{i} F/g_{i}} \ mod\ y^{d} \f$,
    273 /// where \f$ F= \prod_{i= 1}^{r} {g_{i}} \ mod\ y^{d}\f$ and
    274 /// \f$ F \in K[x][y]\f$ is squarefree, the \f$ \delta_{i} \f$ have degree less
    275 /// than the degree of \f$ g_{i} \f$ in x.
    276 ///
    277 /// @return @a biDiophantine returns a list of polynomials \f$ \delta_{i} \f$ as
    278 ///         specified above
    279 /// @sa diophantine(), multiRecDiophantine()
    280 static inline
    281 CFList
    282 biDiophantine (const CanonicalForm& F, ///< [in] compressed, bivariate poly
    283                const CFList& factors,  ///< [in] list of monic bivariate factors
    284                                        ///< including LC (F, Variable (1)) as
    285                                        ///< first element
    286                const int d             ///< [in] precision
    287               );
    288 
    289 /// solve the multivariate polynomial diophantine equation
    290 /// \f$ 1\equiv \sum_{i= 1}^{r} {\delta_{i} F/g_{i}} \ mod\ <M,F.mvar()^{d}>\f$,
    291 /// where \f$ F= \prod_{i= 1}^{r} {g_{i}} \ mod\ <M,F.mvar()^{d}>\f$ and
    292 /// \f$ F \in K[x][x_1,\ldots , x_n]\f$ is squarefree, the \f$ \delta_{i} \f$
    293 /// have degree less than the degree of \f$ g_{i} \f$ in x.
    294 ///
    295 /// @return @a multiDiophantine returns a list of polynomials \f$ \delta_{i} \f$
    296 ///         as specified above
    297 /// @sa diophantine(), biDiophantine()
    298 static inline
    299 CFList
    300 multiRecDiophantine (
    301                const CanonicalForm& F,   ///< [in] compressed,
    302                                          ///< multivariate polynomial
    303                const CFList& factors,    ///< [in] list of monic factors
    304                                          ///< including LC (F, Variable (1)) as
    305                                          ///< first element
    306                const CFList& recResult, ///< [in] result of above equation
    307                                          ///< modulo M
    308                const CFList& M,          ///< [in] a list of powers of Variables
    309                                          ///< of level higher than 1
    310                const int d               ///< [in] precision
    311                     );
    312211
    313212/// Hensel lifting from bivariate to trivariate.
     
    431330            );
    432331
    433 /// Hensel lifting of non monic factors, needs correct leading coefficients of 
     332/// Hensel lifting of non monic factors, needs correct leading coefficients of
    434333/// factors and a one to one corresponds between bivariate and multivariate
    435334/// factors to succeed
    436335///
    437336/// @return @a nonMonicHenselLift returns a list of lifted factors
    438 /// such that prod (factors) == eval.getLast() if there is a one to one 
     337/// such that prod (factors) == eval.getLast() if there is a one to one
    439338/// correspondence
    440339CFList
    441340nonMonicHenselLift (const CFList& eval,    ///< [in] a list of polys the last
    442                                            ///< element is a compressed 
     341                                           ///< element is a compressed
    443342                                           ///< multivariate poly, last but one
    444343                                           ///< element equals the last elements
    445                                            ///< modulo its main variable and so 
    446                                            ///< on. The first element is a 
     344                                           ///< modulo its main variable and so
     345                                           ///< on. The first element is a
    447346                                           ///< compressed poly in 3 variables
    448347                    const CFList& factors, ///< [in] a list of bivariate factors
    449348                    CFList* const& LCs,    ///< [in] leading coefficients,
    450                                            ///< evaluated in the same way as 
     349                                           ///< evaluated in the same way as
    451350                                           ///< eval
    452351                    CFList& diophant,      ///< [in, out] solution of univariate
    453                                            ///< diophantine equation 
     352                                           ///< diophantine equation
    454353                    CFArray& Pi,           ///< [in, out] buffer intermediate
    455354                                           ///< results
  • factory/facIrredTest.cc

    r6e2ef0e rc1b9927  
    11/*****************************************************************************\
    2  * Computer Algebra System SINGULAR   
     2 * Computer Algebra System SINGULAR
    33\*****************************************************************************/
    44/** @file facIrredTest.cc
    5  * 
     5 *
    66 * This file implements a probabilistic irreducibility test for polynomials over
    77 * Z/p.
    8  * 
     8 *
    99 * @author Martin Lee
    1010 *
     
    2424double numZeros (const CanonicalForm& F, int k)
    2525{
    26   int p= getCharacteristic();
    2726  int result= 0;
    2827
     
    3231  {
    3332    buf= F;
    34     for (int j= F.level(); j > 0; j++) 
     33    for (int j= F.level(); j > 0; j++)
    3534      buf= buf (FFgen.generate(), j);
    3635    if (buf.isZero())
     
    9998  int trials= (int) floor (pow (sqrtTrials, 2.0));
    10099
    101   double l= 2.0;
    102100  double experimentalNumZeros= numZeros (G, trials);
    103101
  • factory/fac_sqrfree.cc

    r6e2ef0e rc1b9927  
    150150        y = gcd( w, c ); z = w / y;
    151151        if ( degree( z, v ) > 0 )
     152        {
    152153            if ( lc( z ).sign() < 0 )
    153154                F.append( CFFactor( -z, i ) );
    154155            else
    155156                F.append( CFFactor( z, i ) );
     157        }
    156158        i++;
    157159        w = y; c = c / y;
    158160    }
    159161    if ( degree( w,v ) > 0 )
     162    {
    160163        if ( lc( w ).sign() < 0 )
    161164            F.append( CFFactor( -w, i ) );
    162165        else
    163166            F.append( CFFactor( w, i ) );
     167    }
    164168    if ( ! cont.isOne() )
    165169        F = Union( F, sqrFreeZ( cont ) );
  • factory/fac_univar.cc

    r6e2ef0e rc1b9927  
    9898    for ( i = F; i.hasItem(); i++ )
    9999        if ( (k = i.getItem().factor().degree()) < n )
     100        {
    100101            if ( k == -1 ) {
    101102                STICKYWARN( k == -1, "there occured an error.  factory was not able to factorize\n"
     
    106107            else if ( k != 0 )
    107108                a[k] = 1;
     109        }
    108110}
    109111
     
    115117    for ( i = 1; i < m; i++ )
    116118        if ( (k = F[i].degree()) < n )
    117             if ( k == -1 ) {
     119        {
     120            if ( k == -1 )
     121            {
    118122                STICKYWARN( k == -1, "there occured an error.  factory was not able to factorize\n"
    119123                            "correctly mod p.  Please send the example which caused\n"
     
    123127            else if ( k != 0 )
    124128                a[k] = 1;
     129        }
    125130}
    126131
Note: See TracChangeset for help on using the changeset viewer.