Changeset 227efd in git for coeffs/coeffs.h


Ignore:
Timestamp:
Jun 16, 2010, 5:58:04 PM (14 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
0eb229de7f102c905e5f2b8497a9a524f8ede977
Parents:
584cbc74b85aa9f5b4e31e70416327028b017132
git-author:
Hans Schoenemann <hannes@mathematik.uni-kl.de>2010-06-16 17:58:04+02:00
git-committer:
Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 11:55:11+01:00
Message:
debug stuff enabled
(and some names changed: always remember: we all have to type these
names: so they should be descriptive, but not longer.
For example: what other type then BOOLEAN should n_Equal return ?)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • coeffs/coeffs.h

    r584cbc r227efd  
    1010
    1111#include <auxiliary.h>
     12/* for assume: */
     13#include <reporter.h>
    1214#include <si_gmp.h>
    1315
     
    3941#endif
    4042
    41 // and the routines w.r.t. currRing:
     43// the access methods (part 1) (see also part2 below):
     44//
     45// the routines w.r.t. currRing:
    4246// (should only be used in the context of currRing, i.e. in the interpreter)
    4347#define nCopy(n)          n_Copy(n, currRing->cf)
     
    218222inline void nSetChar(coeffs r)
    219223{
    220   if ((r!=NULL) && (r->cfSetChar!=NULL)) r->cfSetChar(r);
     224  assume(r!=NULL); // r==NULL is an error
     225  if (r->cfSetChar!=NULL) r->cfSetChar(r);
    221226}
    222227
     
    226231
    227232
    228 // the access methods:
     233// the access methods (part 2):
    229234
    230235/// return a copy of a
     
    232237static inline void   n_Delete(number* p, const coeffs r){ return (r)->cfDelete(p, r); }
    233238
    234 static inline BOOLEAN n_AreEqual(number a, number b, const coeffs r){ return (r)->cfEqual(a, b, r); }
     239static inline BOOLEAN n_Equal(number a, number b, const coeffs r){ return (r)->cfEqual(a, b, r); }
    235240static inline BOOLEAN n_IsZero(number n, const coeffs r){ return (r)->cfIsZero(n,r); }
    236241static inline BOOLEAN n_IsOne(number n,  const coeffs r){ return (r)->cfIsOne(n,r); }
    237242static inline BOOLEAN n_IsMOne(number n, const coeffs r){ return (r)->cfIsMOne(n,r); }
    238 static inline BOOLEAN n_IsGreaterZero(number n, const coeffs r){ return (r)->cfGreaterZero(n,r); }
     243static inline BOOLEAN n_GreaterZero(number n, const coeffs r){ return (r)->cfGreaterZero(n,r); }
    239244// cfGreater?
    240245
     
    248253static inline number n_Invers(number a,  const coeffs r){ return (r)->cfInvers(a,r); }
    249254
    250 /// how complicated, (0) => 0, otherwise positive
     255/// use for pivot strategies, (0) => 0, otherwise positive
    251256static inline int    n_Size(number n,    const coeffs r){ return (r)->cfSize(n,r); }
    252257
     
    254259static inline void   n_Normalize(number& n, const coeffs r){ return (r)->cfNormalize(n,r); }
    255260
    256 /// Normalize and Write
     261/// Normalize and Write to the output buffer of reporter
    257262static inline void   n_Write(number& n,  const coeffs r){ return (r)->cfWrite(n,r); }
    258263
     
    267272
    268273static inline number n_Mult(number a, number b, const coeffs r){ return (r)->cfMult(a, b, r); }
     274
    269275/// Inplace multiplication: a := a * b
    270276static inline void n_InpMult(number &a, number b, const coeffs r){ return (r)->cfInpMult(a,b,r); }
     
    279285static inline number n_Gcd(number a, number b, const coeffs r){ return (r)->cfGcd(a,b,r); }
    280286
    281 /// Tests whether n is a correct number.
     287#ifdef LDEBUG
     288/// Tests whether n is a correct number: only used if LDEBUG is defined
    282289static inline BOOLEAN n_DBTest(number n, const char *filename, const int linenumber, const coeffs r)
    283290{
    284 #ifdef LDEBUG
    285291  return (r)->cfDBTest(n, filename, linenumber, r);
    286 #else
    287   return TRUE;
    288 #endif
    289292}
    290293/// BOOLEAN n_Test(number a, const coeffs r)
    291294#define n_Test(a,r)  n_DBTest(a, __FILE__, __LINE__, r)
     295#else
     296#define n_Test(a,r)  (1)
     297#endif
    292298
    293299// Missing wrappers for:
     
    297303
    298304// Deprecated:
    299 static inline BOOLEAN n_GreaterZero(number n, const coeffs r){ return n_IsGreaterZero(n,r); }
    300 static inline BOOLEAN n_Equal(number a, number b, const coeffs r){ return n_AreEqual(a, b, r); }
    301 
    302 // Deprecated:
    303305static inline int n_GetChar(const coeffs r){ return nInternalChar(r); }
    304306
Note: See TracChangeset for help on using the changeset viewer.