Changeset e6f1e6 in git for libpolys


Ignore:
Timestamp:
May 17, 2016, 5:26:29 PM (8 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
6f203b6a99801e807e56ef784f79d4951204b9e5
Parents:
f8fb93d1bc922d1e97207d1d5b347fe1db1eedcf
Message:
code cleanup: HAVE_RINGS is mostly not needed
Location:
libpolys
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • libpolys/coeffs/coeffs.h

    rf8fb93d re6f1e6  
    744744
    745745// Tests:
     746#ifdef HAVE_RINGS
    746747static FORCE_INLINE BOOLEAN nCoeff_is_Ring_2toM(const coeffs r)
    747748{ assume(r != NULL); return (getCoeffType(r)==n_Z2m); }
     
    758759static FORCE_INLINE BOOLEAN nCoeff_is_Ring(const coeffs r)
    759760{ assume(r != NULL); return (r->is_field==0); }
     761#else
     762#define nCoeff_is_Ring_2toM(A) 0
     763#define nCoeff_is_Ring_ModN(A) 0
     764#define nCoeff_is_Ring_PtoM(A) 0
     765#define nCoeff_is_Ring_Z(A)    0
     766#define nCoeff_is_Ring(A)      0
     767#endif
    760768
    761769/// returns TRUE, if r is a field or r has no zero divisors (i.e is a domain)
  • libpolys/polys/kbuckets.cc

    rf8fb93d re6f1e6  
    588588      if (i<coef_start)
    589589        bucket->buckets[i] = p_Mult_nn(bucket->buckets[i], n, r);
    590 #ifdef HAVE_RINGS
    591590        /* Frank Seelisch on March 11, 2010:
    592591           This looks a bit strange: The following "if" is indented
     
    601600          kBucketAdjust(bucket, i);
    602601        }
    603 #endif
    604602      else
    605603      if (bucket->coef[i]!=NULL)
     
    613611#else
    614612      bucket->buckets[i] = p_Mult_nn(bucket->buckets[i], n, r);
    615 #ifdef HAVE_RINGS
    616613      if (rField_is_Ring(r) && !(rField_is_Domain(r)))
    617614      {
     
    619616        kBucketAdjust(bucket, i);
    620617      }
    621 #endif
    622618#endif
    623619    }
     
    719715  i = pLogLength(l1);
    720716
    721 #if defined(HAVE_RINGS)||defined(HAVE_PLURAL)
     717#if defined(HAVE_PLURAL)
    722718  if ((rField_is_Ring(r) && !(rField_is_Domain(r)))
    723719  ||(rIsPluralRing(r)))
  • libpolys/polys/monomials/p_polys.cc

    rf8fb93d re6f1e6  
    12211221
    12221222/*2
    1223 *test if a monomial /head term is a pure power
     1223*test if a monomial /head term is a pure power,
     1224* i.e. depends on only one variable
    12241225*/
    12251226int p_IsPurePower(const poly p, const ring r)
    12261227{
    1227 #ifdef HAVE_RINGS
    1228   if (rField_is_Ring(r))
    1229           {
    1230           if (p == NULL) return 0;
    1231           if (!n_IsUnit(pGetCoeff(p), r->cf)) return 0;
    1232           }
    1233 #endif
    12341228  int i,k=0;
    12351229
     
    21842178          }
    21852179          if ((pNext(rc) != NULL)
    2186 #ifdef HAVE_RINGS
    21872180             || rField_is_Ring(r)
    2188 #endif
    21892181             )
    21902182            return p_Pow(p,i,r);
     
    22302222
    22312223
    2232 #ifdef HAVE_RINGS
    22332224  if (rField_is_Ring(r))
    22342225  {
     
    22552246    return;
    22562247  }
    2257 #endif
    22582248  number h,d;
    22592249  poly p;
     
    27332723  number d, h;
    27342724
    2735 #ifdef HAVE_RINGS
    27362725  if (rField_is_Ring(r))
    27372726  {
     
    27402729    return p;
    27412730  }
    2742 #endif
    27432731
    27442732  if (rField_is_Zp(r) && TEST_OPT_INTSTRATEGY)
     
    30283016  poly p;
    30293017
    3030 #ifdef HAVE_RINGS
    30313018  if (rField_is_Ring(r))
    30323019  {
     
    30363023    return;
    30373024  }
    3038 #endif
    30393025
    30403026  if (rField_is_Zp(r) && TEST_OPT_INTSTRATEGY)
     
    35773563void p_Norm(poly p1, const ring r)
    35783564{
    3579 #ifdef HAVE_RINGS
    35803565  if (rField_is_Ring(r))
    35813566  {
     
    35833568    // Werror("p_Norm not possible in the case of coefficient rings.");
    35843569  }
    3585   else
    3586 #endif
    3587   if (p1!=NULL)
     3570  else if (p1!=NULL)
    35883571  {
    35893572    if (pNext(p1)==NULL)
     
    43954378  if (pLength(p1) != pLength(p2))
    43964379    return FALSE;
    4397 #ifdef HAVE_RINGS
    43984380  if (rField_is_Ring(r))
    43994381  {
    44004382    if (!n_DivBy(p_GetCoeff(p1, r), p_GetCoeff(p2, r), r)) return FALSE;
    44014383  }
    4402 #endif
    44034384  n=n_Div(p_GetCoeff(p1,r),p_GetCoeff(p2,r),r);
    44044385  while ((p1 != NULL) /*&& (p2 != NULL)*/)
  • libpolys/polys/monomials/p_polys.h

    rf8fb93d re6f1e6  
    18071807{
    18081808  if (p == NULL) return FALSE;
    1809 #ifdef HAVE_RINGS
    18101809  if (rField_is_Ring(r))
    18111810    return (p_LmIsConstant(p, r) && n_IsUnit(pGetCoeff(p),r->cf));
    1812 #endif
    18131811  return p_LmIsConstant(p, r);
    18141812}
  • libpolys/polys/monomials/ring.cc

    rf8fb93d re6f1e6  
    33753375  if ( (r->cf->extRing!=NULL)
    33763376      || rField_is_Q(r)
    3377 #ifdef HAVE_RINGS
    33783377      || rField_is_Ring(r)
    3379 #endif
    33803378  )
    33813379    r->options |= Sy_bit(OPT_INTSTRATEGY);
     
    51185116  if (rField_is_Q_a(r))    return getCoeffType(r->cf);
    51195117  if (rField_is_long_C(r)) return n_long_C;
    5120   #ifdef HAVE_RINGS
    5121    if (rField_is_Ring_Z(r)) return n_Z;
    5122    if (rField_is_Ring_ModN(r)) return n_Zn;
    5123    if (rField_is_Ring_PtoM(r)) return n_Znm;
    5124    if (rField_is_Ring_2toM(r)) return  n_Z2m;
    5125   #endif
     5118  if (rField_is_Ring_Z(r)) return n_Z;
     5119  if (rField_is_Ring_ModN(r)) return n_Zn;
     5120  if (rField_is_Ring_PtoM(r)) return n_Znm;
     5121  if (rField_is_Ring_2toM(r)) return  n_Z2m;
    51265122
    51275123  return n_unknown;
  • libpolys/polys/operations/p_Mult_q.cc

    rf8fb93d re6f1e6  
    7070  assume(p != NULL && pNext(p) != NULL && q != NULL && pNext(q) != NULL);
    7171  pAssume1(! pHaveCommonMonoms(p, q));
    72 #ifdef HAVE_RINGS
    7372  assume(!rField_is_Ring(r) || rField_is_Domain(r));
    74 #endif
    7573  assume(lp >= 1 && lq >= 1);
    7674  p_Test(p, r);
  • libpolys/polys/simpleideals.cc

    rf8fb93d re6f1e6  
    267267        if (id->m[j]!=NULL)
    268268        {
    269 #ifdef HAVE_RINGS
    270269          if (rField_is_Ring(r))
    271270          {
     
    281280            if (p_ComparePolys(id->m[i], id->m[j],r)) p_Delete(&id->m[j],r);
    282281          }
    283 #else
    284           if (p_ComparePolys(id->m[i], id->m[j],r)) p_Delete(&id->m[j],r);
    285 #endif
    286282        }
    287283      }
     
    357353        if (id->m[j]!=NULL)
    358354        {
    359 #ifdef HAVE_RINGS
    360355          if (rField_is_Ring(r))
    361356          {
     
    372367          else
    373368          {
    374 #endif
    375           /* the case of a ground field: */
    376           if (p_DivisibleBy(id->m[i], id->m[j],r))
    377           {
    378             p_Delete(&id->m[j],r);
     369            /* the case of a ground field: */
     370            if (p_DivisibleBy(id->m[i], id->m[j],r))
     371            {
     372              p_Delete(&id->m[j],r);
     373            }
     374            else if (p_DivisibleBy(id->m[j], id->m[i],r))
     375            {
     376              p_Delete(&id->m[i],r);
     377              break;
     378            }
    379379          }
    380           else if (p_DivisibleBy(id->m[j], id->m[i],r))
    381           {
    382             p_Delete(&id->m[i],r);
    383             break;
    384           }
    385 #ifdef HAVE_RINGS
    386           }
    387 #endif
    388380        }
    389381      }
     
    14331425      if (componentIsUsed[j]==0)
    14341426      {
    1435 #ifdef HAVE_RINGS
    14361427        if (p_LmIsConstantComp(p,r) &&
    14371428            (!rField_is_Ring(r) || n_IsUnit(pGetCoeff(p),r->cf)))
    14381429        {
    1439 #else
    1440         if (p_LmIsConstantComp(p,r))
    1441         {
    1442 #endif
    14431430          generator = i;
    14441431          componentIsUsed[j] = 1;
Note: See TracChangeset for help on using the changeset viewer.