Changeset eb55f8a in git for libpolys


Ignore:
Timestamp:
Sep 16, 2014, 4:56:19 PM (10 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'd08f5f0bb3329b8ca19f23b74cb1473686415c3a')
Children:
5b45a4ff15d0998cc64c730af75c1c1f773d4a77
Parents:
4ec0f01d431893a4c0997d2bdfab87cb8d37e03e
git-author:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2014-09-16 16:56:19+02:00
git-committer:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2014-09-23 20:10:49+02:00
Message:
There should be no *Test in assume call (and no assume in *Test definition)
Location:
libpolys
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • libpolys/coeffs/coeffs.h

    r4ec0f0 reb55f8a  
    708708static inline BOOLEAN n_DBTest(number n, const char *filename, const int linenumber, const coeffs r)
    709709#else
    710 static inline BOOLEAN n_DBTest(number, const char*, const int, const coeffs)
     710static inline BOOLEAN n_DBTest(number, const char*, const int, const coeffs) // is it really necessary to define this function in any case?
    711711#endif
    712712{
    713   assume(r != NULL);
    714 #ifdef LDEBUG
    715   assume(r->cfDBTest != NULL);
     713#ifndef LDEBUG
     714  return TRUE;
     715#else
     716  assume(r != NULL); assume(r->cfDBTest != NULL);
    716717  return r->cfDBTest(n, filename, linenumber, r);
    717 #else
    718   return TRUE;
    719718#endif
    720719}
  • libpolys/coeffs/modulop.cc

    r4ec0f0 reb55f8a  
    5454BOOLEAN npGreaterZero (number k, const coeffs r)
    5555{
    56   assume( n_Test(k, r) );
     56  n_Test(k, r);
    5757
    5858  int h = (int)((long) k);
     
    7070number npMult (number a,number b, const coeffs r)
    7171{
    72   assume( n_Test(a, r) );
    73   assume( n_Test(b, r) );
     72  n_Test(a, r);
     73  n_Test(b, r);
    7474
    7575  if (((long)a == 0) || ((long)b == 0))
    7676    return (number)0;
    7777  number c = npMultM(a,b, r);
    78   assume( n_Test(c, r) );
     78  n_Test(c, r);
    7979  return c;
    8080}
     
    8989
    9090  number c = (number)ii;
    91   assume( n_Test(c, r) );
     91  n_Test(c, r);
    9292  return c;
    9393
     
    100100int npInt(number &n, const coeffs r)
    101101{
    102   assume( n_Test(n, r) );
     102  n_Test(n, r);
    103103
    104104  if ((long)n > (((long)r->ch) >>1)) return (int)((long)n -((long)r->ch));
     
    108108number npAdd (number a, number b, const coeffs r)
    109109{
    110   assume( n_Test(a, r) );
    111   assume( n_Test(b, r) );
     110  n_Test(a, r);
     111  n_Test(b, r);
    112112
    113113  number c = npAddM(a,b, r);
    114114
    115   assume( n_Test(c, r) );
     115  n_Test(c, r);
    116116
    117117  return c;
     
    120120number npSub (number a, number b, const coeffs r)
    121121{
    122   assume( n_Test(a, r) );
    123   assume( n_Test(b, r) );
     122  n_Test(a, r);
     123  n_Test(b, r);
    124124
    125125  number c = npSubM(a,b,r);
    126126
    127   assume( n_Test(c, r) );
     127  n_Test(c, r);
    128128
    129129  return c;
     
    132132BOOLEAN npIsZero (number  a, const coeffs r)
    133133{
    134   assume( n_Test(a, r) );
     134  n_Test(a, r);
    135135
    136136  return 0 == (long)a;
     
    139139BOOLEAN npIsOne (number a, const coeffs r)
    140140{
    141   assume( n_Test(a, r) );
     141  n_Test(a, r);
    142142
    143143  return 1 == (long)a;
     
    146146BOOLEAN npIsMOne (number a, const coeffs r)
    147147{
    148   assume( n_Test(a, r) );
     148  n_Test(a, r);
    149149
    150150  return ((r->npPminus1M == (long)a)&&((long)1!=(long)a));
     
    201201inline number npInversM (number c, const coeffs r)
    202202{
    203   assume( n_Test(c, r) );
     203  n_Test(c, r);
    204204#ifndef HAVE_DIV_MOD
    205205  number d = (number)(long)r->npExpTable[r->npPminus1M - r->npLogTable[(long)c]];
     
    213213  number d = (number)inv;
    214214#endif
    215   assume( n_Test(d, r) );
     215  n_Test(d, r);
    216216  return d;
    217217
     
    220220number npDiv (number a,number b, const coeffs r)
    221221{
    222   assume( n_Test(a, r) );
    223   assume( n_Test(b, r) );
     222  n_Test(a, r);
     223  n_Test(b, r);
    224224
    225225//#ifdef NV_OPS
     
    247247#endif
    248248
    249   assume( n_Test(d, r) );
     249  n_Test(d, r);
    250250  return d;
    251251
     
    253253number  npInvers (number c, const coeffs r)
    254254{
    255   assume( n_Test(c, r) );
     255  n_Test(c, r);
    256256
    257257  if ((long)c==0)
     
    262262  number d = npInversM(c,r);
    263263
    264   assume( n_Test(d, r) );
     264  n_Test(d, r);
    265265  return d;
    266266
     
    269269number npNeg (number c, const coeffs r)
    270270{
    271   assume( n_Test(c, r) );
     271  n_Test(c, r);
    272272
    273273  if ((long)c==0) return c;
     
    275275#if 0
    276276  number d = npNegM(c,r);
    277   assume( n_Test(d, r) );
     277  n_Test(d, r);
    278278  return d;
    279279#else
    280280  c = npNegM(c,r);
    281   assume( n_Test(c, r) );
     281  n_Test(c, r);
    282282  return c;
    283283#endif
     
    286286BOOLEAN npGreater (number a,number b, const coeffs r)
    287287{
    288   assume( n_Test(a, r) );
    289   assume( n_Test(b, r) );
     288  n_Test(a, r);
     289  n_Test(b, r);
    290290
    291291  //return (long)a != (long)b;
     
    295295BOOLEAN npEqual (number a,number b, const coeffs r)
    296296{
    297   assume( n_Test(a, r) );
    298   assume( n_Test(b, r) );
     297  n_Test(a, r);
     298  n_Test(b, r);
    299299
    300300//  return (long)a == (long)b;
     
    305305void npWrite (number &a, const coeffs r)
    306306{
    307   assume( n_Test(a, r) );
     307  n_Test(a, r);
    308308
    309309  if ((long)a>(((long)r->ch) >>1)) StringAppend("-%d",(int)(((long)r->ch)-((long)a)));
     
    314314void npPower (number a, int i, number * result, const coeffs r)
    315315{
    316   assume( n_Test(a, r) );
     316  n_Test(a, r);
    317317
    318318  if (i==0)
     
    379379    }
    380380  }
    381   assume( n_Test(*a, r) );
     381  n_Test(*a, r);
    382382  return s;
    383383}
  • libpolys/polys/ext_fields/algext.cc

    r4ec0f0 reb55f8a  
    936936  }
    937937  definiteReduce(p, dst->extRing->qideal->m[0], dst);
    938   assume (p_Test (p, dst->extRing));
     938  p_Test (p, dst->extRing);
    939939  if (!DENIS1(fa))
    940940  {
    941941    definiteReduce(q, dst->extRing->qideal->m[0], dst);
    942     assume (p_Test (q, dst->extRing));
     942    p_Test (q, dst->extRing);
    943943    if (q != NULL)
    944944    {
     
    999999  poly g = prMapR(f, nMap, rSrc, rDst);
    10001000
    1001   assume(n_Test((number)g, dst));
     1001  n_Test((number)g, dst);
    10021002  return (number)g;
    10031003}
     
    10291029    result=(number)g;
    10301030
    1031   assume(n_Test((number)result, dst));
     1031  n_Test((number)result, dst);
    10321032  return (number)result;
    10331033}
  • libpolys/polys/ext_fields/transext.cc

    r4ec0f0 reb55f8a  
    8080
    8181#ifdef LDEBUG
    82 #define ntTest(a) assume(ntDBTest(a,__FILE__,__LINE__,cf))
     82#define ntTest(a) ntDBTest(a,__FILE__,__LINE__,cf)
    8383BOOLEAN  ntDBTest(number a, const char *f, const int l, const coeffs r);
    8484#else
     
    193193  const poly num = NUM(t);
    194194  assume(num != NULL);   /**< t != 0 ==> numerator(t) != 0 */
    195   assume( _p_Test(num, ntRing,1) );
     195 
     196  p_Test(num, ntRing);
    196197
    197198  const poly den = DEN(t);
     
    199200  if (den != NULL) // !DENIS1(f)
    200201  {
    201     assume( _p_Test(den, ntRing,1) );
     202    p_Test(den, ntRing);
    202203
    203204    if(p_IsConstant(den, ntRing) && (n_IsOne(pGetCoeff(den), ntCoeffs)))
     
    17601761{
    17611762  if (n_IsZero(a, src)) return NULL;
    1762   assume(n_Test(a, src));
     1763  n_Test(a, src);
    17631764  assume(src->rep == dst->extRing->cf->rep);
    17641765  if ((SR_HDL(a) & SR_INT) || (a->s==3))
     
    17821783{
    17831784  if (n_IsZero(a, src)) return NULL;
    1784   assume(n_Test(a, src));
     1785  n_Test(a, src);
    17851786  nMapFunc nMap=n_SetMap(src,dst->extRing->cf);
    17861787  poly p=p_NSet(nMap(a, src,dst->extRing->cf), dst->extRing);
     
    17961797{
    17971798  if (n_IsZero(a, src)) return NULL;
    1798   assume(n_Test(a, src));
     1799  n_Test(a, src);
    17991800  /* mapping via intermediate int: */
    18001801  int n = n_Int(a, src);
     
    18341835  COM(result) = COM(f);
    18351836  //check_N((number)result,dst);
    1836   assume(n_Test((number)result, dst));
     1837  n_Test((number)result, dst);
    18371838  return (number)result;
    18381839}
     
    18611862  COM(result) = COM(f);
    18621863  //check_N((number)result,dst);
    1863   assume(n_Test((number)result, dst));
     1864  n_Test((number)result, dst);
    18641865  return (number)result;
    18651866}
     
    18671868number ntCopyAlg(number a, const coeffs cf, const coeffs dst)
    18681869{
    1869   assume( n_Test(a, cf) );
     1870  n_Test(a, cf) ;
    18701871  if (n_IsZero(a, cf)) return NULL;
    18711872  return ntInit(prCopyR((poly)a, cf->extRing, dst->extRing),dst);
     
    18741875number ntGenAlg(number a, const coeffs cf, const coeffs dst)
    18751876{
    1876   assume( n_Test(a, cf) );
     1877  n_Test(a, cf) ;
    18771878  if (n_IsZero(a, cf)) return NULL;
    18781879
     
    18841885number ntMap0P(number a, const coeffs src, const coeffs dst)
    18851886{
    1886   assume( n_Test(a, src) );
     1887  n_Test(a, src) ;
    18871888  if (n_IsZero(a, src)) return NULL;
    18881889  // int p = rChar(dst->extRing);
     
    18991900  fraction f = (fraction)omAlloc0Bin(fractionObjectBin);
    19001901  NUM(f) = g; // DEN(f) = NULL; COM(f) = 0;
    1901   assume(n_Test((number)f, dst));
     1902  n_Test((number)f, dst);
    19021903  //check_N((number)f,dst);
    19031904  return (number)f;
     
    19071908number ntMapPP(number a, const coeffs src, const coeffs dst)
    19081909{
    1909   assume( n_Test(a, src) );
     1910  n_Test(a, src) ;
    19101911  if (n_IsZero(a, src)) return NULL;
    19111912  assume(src == dst->extRing->cf);
     
    19141915  fraction f = (fraction)omAlloc0Bin(fractionObjectBin);
    19151916  NUM(f) = p; // DEN(f) = NULL; COM(f) = 0;
    1916   assume(n_Test((number)f, dst));
     1917  n_Test((number)f, dst);
    19171918  //check_N((number)f,dst);
    19181919  return (number)f;
     
    19221923number ntMapUP(number a, const coeffs src, const coeffs dst)
    19231924{
    1924   assume( n_Test(a, src) );
     1925  n_Test(a, src) ;
    19251926  if (n_IsZero(a, src)) return NULL;
    19261927  /* mapping via intermediate int: */
     
    19371938  fraction f = (fraction)omAlloc0Bin(fractionObjectBin);
    19381939  NUM(f) = p; // DEN(f) = NULL; COM(f) = 0;
    1939   assume(n_Test((number)f, dst));
     1940  n_Test((number)f, dst);
    19401941  //check_N((number)f,dst);
    19411942  return (number)f;
  • libpolys/polys/kbuckets.cc

    r4ec0f0 reb55f8a  
    9292  {
    9393    assume(bucket->buckets[i]!=NULL);
    94     _p_Test(bucket->coef[i],bucket->bucket_ring,PDEBUG);
    95     }
     94    p_Test(bucket->coef[i],bucket->bucket_ring);
     95  }
    9696  #endif
    9797  pFalseReturn(p_Test(bucket->buckets[i], bucket->bucket_ring));
  • libpolys/polys/monomials/p_polys.cc

    r4ec0f0 reb55f8a  
    694694long p_DegW(poly p, const short *w, const ring R)
    695695{
    696   assume( p_Test(p, R) );
     696  p_Test(p, R);
    697697  assume( w != NULL );
    698698  long r=-LONG_MAX;
     
    38823882    qq = p_PermPoly(zz, par_perm-1, srcExtRing, dst, nMap, NULL, rVar (srcExtRing)-1);
    38833883
    3884   assume (p_Test (qq, dst));
     3884  p_Test (qq, dst);
    38853885
    38863886//       poly p_PermPoly (poly p, int * perm, const ring oldRing, const ring dst, nMapFunc nMap, int *par_perm, int OldPar)
     
    39223922      number n = nMap(p_GetCoeff(p, oldRing), oldRing->cf, dst->cf);
    39233923
    3924       assume (n_Test (n,dst->cf));
     3924      n_Test (n,dst->cf);
    39253925
    39263926      if ( nCoeff_is_algExt(dst->cf) )
  • libpolys/polys/monomials/p_polys.h

    r4ec0f0 reb55f8a  
    245245  if (p != NULL)
    246246  {
    247 #ifdef PDEBUG
    248247    p_Test(p, r);
    249 #endif
    250248    if (rOrd_SetCompRequiresSetm(r))
    251249    {
     
    806804static inline poly p_Copy(poly p, const ring r)
    807805{
    808 #ifdef PDEBUG
    809   poly pp= r->p_Procs->p_Copy(p, r);
     806  const poly pp = r->p_Procs->p_Copy(p, r);
    810807  p_Test(pp,r);
    811808  return pp;
    812 #else
    813   return r->p_Procs->p_Copy(p, r);
    814 #endif
    815809}
    816810
     
    831825static inline poly p_Copy(poly p, const ring lmRing, const ring tailRing)
    832826{
     827  if (p != NULL)
     828  {
    833829#ifndef PDEBUG
    834   if (tailRing == lmRing)
    835     return tailRing->p_Procs->p_Copy(p, tailRing);
    836 #endif
    837   if (p != NULL)
    838   {
     830    if (tailRing == lmRing)
     831      return tailRing->p_Procs->p_Copy(p, tailRing);
     832#endif
    839833    poly pres = p_Head(p, lmRing);
    840834    pNext(pres) = tailRing->p_Procs->p_Copy(pNext(p), tailRing);
     
    848842static inline void p_Delete(poly *p, const ring r)
    849843{
     844  assume( p!= NULL );
    850845  r->p_Procs->p_Delete(p, r);
    851846}
     
    853848static inline void p_Delete(poly *p,  const ring lmRing, const ring tailRing)
    854849{
     850  assume( p!= NULL );
     851  if (*p != NULL)
     852  {
    855853#ifndef PDEBUG
    856   if (tailRing == lmRing)
    857   {
    858     tailRing->p_Procs->p_Delete(p, tailRing);
    859     return;
    860   }
    861 #endif
    862   if (*p != NULL)
    863   {
     854    if (tailRing == lmRing)
     855    {
     856      p_Delete(p, tailRing);
     857      return;
     858    }
     859#endif
    864860    if (pNext(*p) != NULL)
    865       tailRing->p_Procs->p_Delete(&pNext(*p), tailRing);
     861      p_Delete(&pNext(*p), tailRing);
    866862    p_LmDelete(p, lmRing);
    867863  }
     
    911907#ifndef PDEBUG
    912908  if (lmRing == tailRing)
    913   {
    914909    return p_Mult_nn(p, n, tailRing);
    915   }
    916910#endif
    917911  poly pnext = pNext(p);
     
    17741768{
    17751769  if (p == NULL) return TRUE;
     1770  p_Test(p, r);
    17761771  return (pNext(p)==NULL) && p_LmIsConstantComp(p, r);
    17771772}
     
    17791774static inline BOOLEAN p_IsConstant(const poly p, const ring r)
    17801775{
    1781   assume( p_Test(p, r) );
    17821776  if (p == NULL) return TRUE;
     1777  p_Test(p, r);
    17831778  return (pNext(p)==NULL) && p_LmIsConstant(p, r);
    17841779}
     
    17871782static inline BOOLEAN p_IsOne(const poly p, const ring R)
    17881783{
    1789   assume( p_Test(p, R) );
     1784  p_Test(p, R);
    17901785  return (p_IsConstant(p, R) && n_IsOne(p_GetCoeff(p, R), R->cf));
    17911786}
     
    17931788static inline BOOLEAN p_IsConstantPoly(const poly p, const ring r)
    17941789{
     1790  p_Test(p, r);
    17951791  poly pp=p;
    17961792  while(pp!=NULL)
Note: See TracChangeset for help on using the changeset viewer.