Changeset f92fc2e in git


Ignore:
Timestamp:
Jun 16, 2010, 3:34:45 PM (13 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
Children:
5dcc9a60fe5f6363361635bb231ee206f6a174b4
Parents:
fb104b7d78bc189a491c27b263c1337ce820192f
git-author:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2010-06-16 15:34:45+02:00
git-committer:
Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 11:55:10+01:00
Message:
Further to inlines!

	../templates/out/
File:
1 edited

Legend:

Unmodified
Added
Removed
  • coeffs/inline_coeffs.h

    rfb104b rf92fc2e  
    118118   /// convertion, 0 if impossible
    119119   int     (*cfInt)(number &n, const coeffs r);
     120
    120121#ifdef HAVE_RINGS
    121122   int     (*cfDivComp)(number a,number b,const coeffs r);
     
    124125   number  (*cfExtGcd)(number a, number b, number *s, number *t,const coeffs r);
    125126#endif
     127
    126128   /// changes argument  inline: a:= -a
    127129   number  (*cfNeg)(number a, const coeffs r);
     
    145147           (*cfIsMOne)(number a, const coeffs r),
    146148           (*cfGreaterZero)(number a, const coeffs r);
     149   
    147150   void    (*cfPower)(number a, int i, number * result, const coeffs r);
    148151   number  (*cfGetDenom)(number &n, const coeffs r);
     
    217220
    218221// the access methods:
     222
     223/// return a copy of a
    219224static inline number n_Copy(number n,    const coeffs r){ return (r)->cfCopy(n, r); }
    220225static inline void   n_Delete(number* p, const coeffs r){ return (r)->cfDelete(p, r); }
     226
     227static inline BOOLEAN n_AreEqual(number a, number b, const coeffs r){ return (r)->cfEqual(a, b, r); }
    221228static inline BOOLEAN n_IsZero(number n, const coeffs r){ return (r)->cfIsZero(n,r); }
    222229static inline BOOLEAN n_IsOne(number n,  const coeffs r){ return (r)->cfIsOne(n,r); }
    223230static inline BOOLEAN n_IsMOne(number n, const coeffs r){ return (r)->cfIsMOne(n,r); }
    224231static inline BOOLEAN n_IsGreaterZero(number n, const coeffs r){ return (r)->cfGreaterZero(n,r); }
     232// cfGreater?
     233
     234/// init with an integer
     235static inline number n_Init(int i,       const coeffs r){ return (r)->cfInit(i,r); }
     236
     237/// changes argument  inline: a:= -a
    225238static inline number n_Neg(number n,     const coeffs r){ return (r)->cfNeg(n,r); }
    226 static inline number n_Init(int i,       const coeffs r){ return (r)->cfInit(i,r); }
     239
     240/// return 1/a
     241static inline number n_Invers(number a,  const coeffs r){ return (r)->cfInvers(a,r); }
     242
     243/// how complicated, (0) => 0, otherwise positive
     244static inline int    n_Size(number n,    const coeffs r){ return (r)->cfSize(n,r); }
     245
     246/// normalize the number. i.e. go to some canonnical representation (inplace)
     247static inline void   n_Normalize(number& n, const coeffs r){ return (r)->cfNormalize(n,r); }
     248
     249/// Normalize and Write
    227250static inline void   n_Write(number& n,  const coeffs r){ return (r)->cfWrite(n,r); }
    228 static inline void   n_Normalize(number& n, const coeffs r){ return (r)->cfNormalize(n,r); }
    229 static inline number n_Invers(number a,  const coeffs r){ return (r)->cfInvers(a,r); }
    230 static inline int    n_Size(number n,    const coeffs r){ return (r)->cfSize(n,r); }
     251
     252/// Normalize and get denomerator
    231253static inline number n_GetDenom(number& n, const coeffs r){ return (r)->cfGetDenom(n, r); }
     254
     255/// Normalize and get numerator
    232256static inline number n_GetNumerator(number& n, const coeffs r){ return (r)->cfGetNumerator(n, r); }
    233257
    234258static inline void   n_Power(number a, int b, number *res, const coeffs r){ return (r)->cfPower(a,b,res,r); }
    235259
    236 static inline number n_Mult(number n1, number n2, const coeffs r){ return (r)->cfMult(n1, n2, r); }
    237 static inline number n_Add(number n1, number n2, const coeffs r){ return (r)->cfAdd(n1, n2, r); }
    238 static inline number n_Equal(number n1, number n2, const coeffs r){ return (r)->cfEqual(n1, n2, r); }
    239 static inline number n_Sub(number n1, number n2, const coeffs r){ return (r)->cfSub(n1, n2, r); }
     260
     261static inline number n_Mult(number a, number b, const coeffs r){ return (r)->cfMult(a, b, r); }
     262/// Inplace multiplication: a := a * b
     263static inline void n_InpMult(number &a, number b, const coeffs r){ return (r)->cfInpMult(a,b,r); }
     264
     265static inline number n_Sub(number a, number b, const coeffs r){ return (r)->cfSub(a, b, r); }
     266static inline number n_Add(number a, number b, const coeffs r){ return (r)->cfAdd(a, b, r); }
     267
     268static inline number n_Div(number a, number b, const coeffs r){ return (r)->cfDiv(a,b,r); }
     269static inline number n_IntDiv(number a, number b, const coeffs r){ return (r)->cfIntDiv(a,b,r); }
     270static inline number n_ExactDiv(number a, number b, const coeffs r){ return (r)->cfExactDiv(a,b,r); }
     271
    240272static inline number n_Gcd(number a, number b, const coeffs r){ return (r)->cfGcd(a,b,r); }
    241 static inline number n_IntDiv(number a, number b, const coeffs r){ return (r)->cfIntDiv(a,b,r); }
    242 static inline number n_Div(number a, number b, const coeffs r){ return (r)->cfDiv(a,b,r); }
    243 static inline number n_ExactDiv(number a, number b, const coeffs r){ return (r)->cfExactDiv(a,b,r); }
    244 static inline number n_InpMult(number a, number b, const coeffs r){ return (r)->cfInpMult(a,b,r); }
    245 
    246 
    247 static inline BOOLEAN n_DBTest(number a, const char *filename, const int linenumber, const coeffs r)
     273
     274/// Tests whether n is a correct number.
     275static inline BOOLEAN n_DBTest(number n, const char *filename, const int linenumber, const coeffs r)
    248276{
    249277#ifdef LDEBUG
    250   return (r)->cfDBTest(a, filename, linenumber, r);
     278  return (r)->cfDBTest(n, filename, linenumber, r);
    251279#else
    252280  return TRUE;
     
    256284#define n_Test(a,r)  n_DBTest(a, __FILE__, __LINE__, r)
    257285
     286// Missing wrappers for:
     287// cfIntMod, cfPar, cfParDeg, cfInt, cfRePart, cfImPart, cfRead, cfLcm, cfSetMap, cfName, cfInit_bigint
     288// HAVE_RINGS: cfDivComp, cfIsUnit, cfGetUnit, cfExtGcd... cfDivBy
     289
     290
    258291// Deprecated:
    259292static inline BOOLEAN n_GreaterZero(number n, const coeffs r){ return n_IsGreaterZero(n,r); }
     293static inline BOOLEAN n_Equal(number a, number b, const coeffs r){ return n_AreEqual(a, b, r); }
    260294
    261295// Deprecated:
Note: See TracChangeset for help on using the changeset viewer.