Changeset df98dd in git for libpolys/coeffs/coeffs.h


Ignore:
Timestamp:
Nov 19, 2014, 7:07:14 PM (10 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b4f17ed1d25f93d46dbe29e4b499baecc2fd51bb')
Children:
ac000b6db9daa244791307cb7daa15521f68941e
Parents:
ca90c606ac5700642199c11e9336ebe0ffd08636
git-author:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2014-11-19 19:07:14+01:00
git-committer:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2014-11-19 19:20:50+01:00
Message:
Force number-operation-wrappers to inline in release/optimization builds
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpolys/coeffs/coeffs.h

    rca90c60 rdf98dd  
    418418// test properties and type
    419419/// Returns the type of coeffs domain
    420 static inline n_coeffType getCoeffType(const coeffs r)
     420static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
    421421{ assume(r != NULL); return r->type; }
    422422
     
    426426
    427427/// "copy" coeffs, i.e. increment ref
    428 static inline coeffs nCopyCoeff(const coeffs r)
     428static FORCE_INLINE coeffs nCopyCoeff(const coeffs r)
    429429{ assume(r!=NULL); r->ref++; return r;}
    430430
     
    433433
    434434/// initialisations after each ring change
    435 static inline void nSetChar(const coeffs r)
     435static FORCE_INLINE void nSetChar(const coeffs r)
    436436{ STATISTIC(nSetChar);  assume(r!=NULL); assume(r->cfSetChar != NULL); r->cfSetChar(r); }
    437437
     
    441441
    442442/// Return the characteristic of the coeff. domain.
    443 static inline int n_GetChar(const coeffs r)
     443static FORCE_INLINE int n_GetChar(const coeffs r)
    444444{ STATISTIC(n_GetChar); assume(r != NULL); return r->ch; }
    445445
     
    448448
    449449/// return a copy of 'n'
    450 static inline number n_Copy(number n,    const coeffs r)
     450static FORCE_INLINE number n_Copy(number n,    const coeffs r)
    451451{ STATISTIC(n_Copy);   assume(r != NULL); assume(r->cfCopy!=NULL); return r->cfCopy(n, r); }
    452452
    453453/// delete 'p'
    454 static inline void   n_Delete(number* p, const coeffs r)
     454static FORCE_INLINE void   n_Delete(number* p, const coeffs r)
    455455{ STATISTIC(n_Delete);   assume(r != NULL); assume(r->cfDelete!= NULL); r->cfDelete(p, r); }
    456456
    457457/// TRUE iff 'a' and 'b' represent the same number;
    458458/// they may have different representations
    459 static inline BOOLEAN n_Equal(number a, number b, const coeffs r)
     459static FORCE_INLINE BOOLEAN n_Equal(number a, number b, const coeffs r)
    460460{ STATISTIC(n_Equal); assume(r != NULL); assume(r->cfEqual!=NULL); return r->cfEqual(a, b, r); }
    461461
    462462/// TRUE iff 'n' represents the zero element
    463 static inline BOOLEAN n_IsZero(number n, const coeffs r)
     463static FORCE_INLINE BOOLEAN n_IsZero(number n, const coeffs r)
    464464{ STATISTIC(n_IsZero); assume(r != NULL); assume(r->cfIsZero!=NULL); return r->cfIsZero(n,r); }
    465465
    466466/// TRUE iff 'n' represents the one element
    467 static inline BOOLEAN n_IsOne(number n,  const coeffs r)
     467static FORCE_INLINE BOOLEAN n_IsOne(number n,  const coeffs r)
    468468{ STATISTIC(n_IsOne); assume(r != NULL); assume(r->cfIsOne!=NULL); return r->cfIsOne(n,r); }
    469469
    470470/// TRUE iff 'n' represents the additive inverse of the one element, i.e. -1
    471 static inline BOOLEAN n_IsMOne(number n, const coeffs r)
     471static FORCE_INLINE BOOLEAN n_IsMOne(number n, const coeffs r)
    472472{ STATISTIC(n_IsMOne); assume(r != NULL); assume(r->cfIsMOne!=NULL); return r->cfIsMOne(n,r); }
    473473
     
    491491///     start with -
    492492///
    493 static inline BOOLEAN n_GreaterZero(number n, const coeffs r)
     493static FORCE_INLINE BOOLEAN n_GreaterZero(number n, const coeffs r)
    494494{ STATISTIC(n_GreaterZero); assume(r != NULL); assume(r->cfGreaterZero!=NULL); return r->cfGreaterZero(n,r); }
    495495
     
    508508/// !!! Recommendation: remove implementations for unordered fields
    509509/// !!!                 and raise errors instead, in these cases
    510 static inline BOOLEAN n_Greater(number a, number b, const coeffs r)
     510static FORCE_INLINE BOOLEAN n_Greater(number a, number b, const coeffs r)
    511511{ STATISTIC(n_Greater); assume(r != NULL); assume(r->cfGreater!=NULL); return r->cfGreater(a,b,r); }
    512512
    513513#ifdef HAVE_RINGS
    514 static inline int n_DivComp(number a, number b, const coeffs r)
     514static FORCE_INLINE int n_DivComp(number a, number b, const coeffs r)
    515515{ STATISTIC(n_DivComp); assume(r != NULL); assume(r->cfDivComp!=NULL); return r->cfDivComp (a,b,r); }
    516516
    517517/// TRUE iff n has a multiplicative inverse in the given coeff field/ring r
    518 static inline BOOLEAN n_IsUnit(number n, const coeffs r)
     518static FORCE_INLINE BOOLEAN n_IsUnit(number n, const coeffs r)
    519519{ STATISTIC(n_IsUnit); assume(r != NULL); assume(r->cfIsUnit!=NULL); return r->cfIsUnit(n,r); }
    520520
     
    526526// CF: shold imply that n/GetUnit(n) is normalized in Z/kZ
    527527//   it would make more sense to return the inverse...
    528 static inline number n_GetUnit(number n, const coeffs r)
     528static FORCE_INLINE number n_GetUnit(number n, const coeffs r)
    529529{ STATISTIC(n_GetUnit); assume(r != NULL); assume(r->cfGetUnit!=NULL); return r->cfGetUnit(n,r); }
    530530
    531 static inline coeffs n_CoeffRingQuot1(number c, const coeffs r)
     531static FORCE_INLINE coeffs n_CoeffRingQuot1(number c, const coeffs r)
    532532{ STATISTIC(n_CoeffRingQuot1); assume(r != NULL); assume(r->cfQuot1 != NULL); return r->cfQuot1(c, r); }
    533533#endif
    534534
    535535/// a number representing i in the given coeff field/ring r
    536 static inline number n_Init(long i,       const coeffs r)
     536static FORCE_INLINE number n_Init(long i,       const coeffs r)
    537537{ STATISTIC(n_Init); assume(r != NULL); assume(r->cfInit!=NULL); return r->cfInit(i,r); }
    538538
    539539/// conversion of a GMP integer to number
    540 static inline number n_InitMPZ(mpz_t n,     const coeffs r)
     540static FORCE_INLINE number n_InitMPZ(mpz_t n,     const coeffs r)
    541541{ STATISTIC(n_InitMPZ); assume(r != NULL); assume(r->cfInitMPZ != NULL); return r->cfInitMPZ(n,r); }
    542542
    543543/// conversion of n to an int; 0 if not possible
    544544/// in Z/pZ: the representing int lying in (-p/2 .. p/2]
    545 static inline int n_Int(number &n,       const coeffs r)
     545static FORCE_INLINE int n_Int(number &n,       const coeffs r)
    546546{ STATISTIC(n_Int); assume(r != NULL); assume(r->cfInt!=NULL); return r->cfInt(n,r); }
    547547
    548548/// conversion of n to a GMP integer; 0 if not possible
    549 static inline void n_MPZ(mpz_t result, number &n,       const coeffs r)
     549static FORCE_INLINE void n_MPZ(mpz_t result, number &n,       const coeffs r)
    550550{ STATISTIC(n_MPZ); assume(r != NULL); assume(r->cfMPZ!=NULL); r->cfMPZ(result, n, r); }
    551551
     
    553553/// in-place negation of n
    554554/// MUST BE USED: n = n_InpNeg(n) (no copy is returned)
    555 static inline number n_InpNeg(number n,     const coeffs r)
     555static FORCE_INLINE number n_InpNeg(number n,     const coeffs r)
    556556{ STATISTIC(n_InpNeg); assume(r != NULL); assume(r->cfInpNeg!=NULL); return r->cfInpNeg(n,r); }
    557557
     
    560560///
    561561/// !!! Recommendation: rename to 'n_Inverse'
    562 static inline number n_Invers(number a,  const coeffs r)
     562static FORCE_INLINE number n_Invers(number a,  const coeffs r)
    563563{ STATISTIC(n_Invers); assume(r != NULL); assume(r->cfInvers!=NULL); return r->cfInvers(a,r); }
    564564
     
    566566/// return 0 only when n represents zero;
    567567/// (used for pivot strategies in matrix computations with entries from r)
    568 static inline int    n_Size(number n,    const coeffs r)
     568static FORCE_INLINE int    n_Size(number n,    const coeffs r)
    569569{ STATISTIC(n_Size); assume(r != NULL); assume(r->cfSize!=NULL); return r->cfSize(n,r); }
    570570
     
    574574/// !!! Recommendation: remove this method from the user-interface, i.e.,
    575575/// !!!                 this should be hidden
    576 static inline void   n_Normalize(number& n, const coeffs r)
     576static FORCE_INLINE void   n_Normalize(number& n, const coeffs r)
    577577{ STATISTIC(n_Normalize); assume(r != NULL); assume(r->cfNormalize!=NULL); r->cfNormalize(n,r); }
    578578
    579579/// write to the output buffer of the currently used reporter
    580580//CF: the "&" should be removed, as one wants to write constants as well
    581 static inline void   n_WriteLong(number& n,  const coeffs r)
     581static FORCE_INLINE void   n_WriteLong(number& n,  const coeffs r)
    582582{ STATISTIC(n_WriteLong); assume(r != NULL); assume(r->cfWriteLong!=NULL); r->cfWriteLong(n,r); }
    583583
    584584/// write to the output buffer of the currently used reporter
    585585/// in a shortest possible way, e.g. in K(a): a2 instead of a^2
    586 static inline void   n_WriteShort(number& n,  const coeffs r)
     586static FORCE_INLINE void   n_WriteShort(number& n,  const coeffs r)
    587587{ STATISTIC(n_WriteShort); assume(r != NULL); assume(r->cfWriteShort!=NULL); r->cfWriteShort(n,r); }
    588588
    589 static inline void   n_Write(number& n,  const coeffs r, const BOOLEAN bShortOut = TRUE)
     589static FORCE_INLINE void   n_Write(number& n,  const coeffs r, const BOOLEAN bShortOut = TRUE)
    590590{ STATISTIC(n_Write); if (bShortOut) n_WriteShort(n, r); else n_WriteLong(n, r); }
    591591
     
    594594/// !!!                 interface. As defined here, it is merely a helper
    595595/// !!!                 method for parsing number input strings.
    596 static inline const char *n_Read(const char * s, number * a, const coeffs r)
     596static FORCE_INLINE const char *n_Read(const char * s, number * a, const coeffs r)
    597597{ STATISTIC(n_Read); assume(r != NULL); assume(r->cfRead!=NULL); return r->cfRead(s, a, r); }
    598598
    599599/// return the denominator of n
    600600/// (if elements of r are by nature not fractional, result is 1)
    601 static inline number n_GetDenom(number& n, const coeffs r)
     601static FORCE_INLINE number n_GetDenom(number& n, const coeffs r)
    602602{ STATISTIC(n_GetDenom); assume(r != NULL); assume(r->cfGetDenom!=NULL); return r->cfGetDenom(n, r); }
    603603
    604604/// return the numerator of n
    605605/// (if elements of r are by nature not fractional, result is n)
    606 static inline number n_GetNumerator(number& n, const coeffs r)
     606static FORCE_INLINE number n_GetNumerator(number& n, const coeffs r)
    607607{ STATISTIC(n_GetNumerator); assume(r != NULL); assume(r->cfGetNumerator!=NULL); return r->cfGetNumerator(n, r); }
    608608
    609609/// return the quotient of 'a' and 'b', i.e., a/b;
    610610/// raise an error if 'b' is not invertible in r
    611 static inline number n_Div(number a, number b, const coeffs r)
     611static FORCE_INLINE number n_Div(number a, number b, const coeffs r)
    612612{ STATISTIC(n_Div); assume(r != NULL); assume(r->cfDiv!=NULL); return r->cfDiv(a,b,r); }
    613613
     
    616616/// n_ExactDiv performs it, may skip additional tests.
    617617/// Can always be substituted by n_Div at the cost of larger  computing time.
    618 static inline number n_ExactDiv(number a, number b, const coeffs r)
     618static FORCE_INLINE number n_ExactDiv(number a, number b, const coeffs r)
    619619{ STATISTIC(n_ExactDiv); assume(r != NULL); assume(r->cfExactDiv!=NULL); return r->cfExactDiv(a,b,r); }
    620620
    621621/// for r a field, return n_Init(0,r)
    622622/// otherwise: n_Div(a,b,r)*b+n_IntMod(a,b,r)==a
    623 static inline number n_IntMod(number a, number b, const coeffs r)
     623static FORCE_INLINE number n_IntMod(number a, number b, const coeffs r)
    624624{ STATISTIC(n_IntMod); assume(r != NULL); return r->cfIntMod(a,b,r); }
    625625
    626626/// fill res with the power a^b
    627 static inline void   n_Power(number a, int b, number *res, const coeffs r)
     627static FORCE_INLINE void   n_Power(number a, int b, number *res, const coeffs r)
    628628{ STATISTIC(n_Power); assume(r != NULL); assume(r->cfPower!=NULL); r->cfPower(a,b,res,r); }
    629629
    630630/// return the product of 'a' and 'b', i.e., a*b
    631 static inline number n_Mult(number a, number b, const coeffs r)
     631static FORCE_INLINE number n_Mult(number a, number b, const coeffs r)
    632632{ STATISTIC(n_Mult); assume(r != NULL); assume(r->cfMult!=NULL); return r->cfMult(a, b, r); }
    633633
    634634/// multiplication of 'a' and 'b';
    635635/// replacement of 'a' by the product a*b
    636 static inline void n_InpMult(number &a, number b, const coeffs r)
     636static FORCE_INLINE void n_InpMult(number &a, number b, const coeffs r)
    637637{ STATISTIC(n_InpMult); assume(r != NULL); assume(r->cfInpMult!=NULL); r->cfInpMult(a,b,r); }
    638638
    639639/// addition of 'a' and 'b';
    640640/// replacement of 'a' by the sum a+b
    641 static inline void n_InpAdd(number &a, number b, const coeffs r)
     641static FORCE_INLINE void n_InpAdd(number &a, number b, const coeffs r)
    642642{ STATISTIC(n_InpAdd); assume(r != NULL); assume(r->cfInpAdd!=NULL); r->cfInpAdd(a,b,r);
    643643
     
    649649
    650650/// return the sum of 'a' and 'b', i.e., a+b
    651 static inline number n_Add(number a, number b, const coeffs r)
     651static FORCE_INLINE number n_Add(number a, number b, const coeffs r)
    652652{ STATISTIC(n_Add); assume(r != NULL); assume(r->cfAdd!=NULL); const number sum = r->cfAdd(a, b, r);
    653653   
     
    662662
    663663/// return the difference of 'a' and 'b', i.e., a-b
    664 static inline number n_Sub(number a, number b, const coeffs r)
     664static FORCE_INLINE number n_Sub(number a, number b, const coeffs r)
    665665{ STATISTIC(n_Sub); assume(r != NULL); assume(r->cfSub!=NULL); const number d = r->cfSub(a, b, r);
    666666
     
    679679/// in K(a)/<p(a)>: not implemented
    680680/// in K(t_1, ..., t_n): not implemented
    681 static inline number n_Gcd(number a, number b, const coeffs r)
     681static FORCE_INLINE number n_Gcd(number a, number b, const coeffs r)
    682682{ STATISTIC(n_Gcd); assume(r != NULL); assume(r->cfGcd!=NULL); return r->cfGcd(a,b,r); }
    683 static inline number n_SubringGcd(number a, number b, const coeffs r)
     683static FORCE_INLINE number n_SubringGcd(number a, number b, const coeffs r)
    684684{ STATISTIC(n_SubringGcd); assume(r != NULL); assume(r->cfSubringGcd!=NULL); return r->cfSubringGcd(a,b,r); }
    685685
    686686/// beware that ExtGCD is only relevant for a few chosen coeff. domains
    687687/// and may perform something unexpected in some cases...
    688 static inline number n_ExtGcd(number a, number b, number *s, number *t, const coeffs r)
     688static FORCE_INLINE number n_ExtGcd(number a, number b, number *s, number *t, const coeffs r)
    689689{ STATISTIC(n_ExtGcd); assume(r != NULL); assume(r->cfExtGcd!=NULL); return r->cfExtGcd (a,b,s,t,r); }
    690 static inline number n_XExtGcd(number a, number b, number *s, number *t, number *u, number *v, const coeffs r)
     690static FORCE_INLINE number n_XExtGcd(number a, number b, number *s, number *t, number *u, number *v, const coeffs r)
    691691{ STATISTIC(n_XExtGcd); assume(r != NULL); assume(r->cfXExtGcd!=NULL); return r->cfXExtGcd (a,b,s,t,u,v,r); }
    692 static inline number  n_EucNorm(number a, const coeffs r)
     692static FORCE_INLINE number  n_EucNorm(number a, const coeffs r)
    693693{ STATISTIC(n_EucNorm); assume(r != NULL); assume(r->cfEucNorm!=NULL); return r->cfEucNorm (a,r); }
    694694/// if r is a ring with zero divisors, return an annihilator!=0 of b
    695695/// otherwise return NULL
    696 static inline number  n_Ann(number a, const coeffs r)
     696static FORCE_INLINE number  n_Ann(number a, const coeffs r)
    697697{ STATISTIC(n_Ann); assume(r != NULL); return r->cfAnn (a,r); }
    698 static inline number  n_QuotRem(number a, number b, number *q, const coeffs r)
     698static FORCE_INLINE number  n_QuotRem(number a, number b, number *q, const coeffs r)
    699699{ STATISTIC(n_QuotRem); assume(r != NULL); assume(r->cfQuotRem!=NULL); return r->cfQuotRem (a,b,q,r); }
    700700
     
    705705/// in K(a)/<p(a)>: not implemented
    706706/// in K(t_1, ..., t_n): not implemented
    707 static inline number n_Lcm(number a, number b, const coeffs r)
     707static FORCE_INLINE number n_Lcm(number a, number b, const coeffs r)
    708708{ STATISTIC(n_Lcm); assume(r != NULL); assume(r->cfLcm!=NULL); return r->cfLcm(a,b,r); }
    709709
    710710/// assume that r is a quotient field (otherwise, return 1)
    711711/// for arguments (a1/a2,b1/b2) return (lcm(a1,b2)/1)
    712 static inline number n_NormalizeHelper(number a, number b, const coeffs r)
     712static FORCE_INLINE number n_NormalizeHelper(number a, number b, const coeffs r)
    713713{ STATISTIC(n_NormalizeHelper); assume(r != NULL); assume(r->cfNormalizeHelper!=NULL); return r->cfNormalizeHelper(a,b,r); }
    714714
    715715/// set the mapping function pointers for translating numbers from src to dst
    716 static inline nMapFunc n_SetMap(const coeffs src, const coeffs dst)
     716static FORCE_INLINE nMapFunc n_SetMap(const coeffs src, const coeffs dst)
    717717{ STATISTIC(n_SetMap); assume(src != NULL && dst != NULL); assume(dst->cfSetMap!=NULL); return dst->cfSetMap(src,dst); }
    718718
     
    720720/// test whether n is a correct number;
    721721/// only used if LDEBUG is defined
    722 static inline BOOLEAN n_DBTest(number n, const char *filename, const int linenumber, const coeffs r)
     722static FORCE_INLINE BOOLEAN n_DBTest(number n, const char *filename, const int linenumber, const coeffs r)
    723723{ STATISTIC(n_Test); assume(r != NULL); assume(r->cfDBTest != NULL); return r->cfDBTest(n, filename, linenumber, r); }
    724724#else
     
    726726/// test whether n is a correct number;
    727727/// only used if LDEBUG is defined
    728 static inline BOOLEAN n_DBTest(number, const char*, const int, const coeffs)
     728static FORCE_INLINE BOOLEAN n_DBTest(number, const char*, const int, const coeffs)
    729729{ STATISTIC(n_Test);  return TRUE; }
    730730#endif
    731731
    732732/// output the coeff description
    733 static inline void   n_CoeffWrite(const coeffs r, BOOLEAN details = TRUE)
     733static FORCE_INLINE void   n_CoeffWrite(const coeffs r, BOOLEAN details = TRUE)
    734734{ STATISTIC(n_CoeffWrite); assume(r != NULL); assume(r->cfCoeffWrite != NULL); r->cfCoeffWrite(r, details); }
    735735
    736736// Tests:
    737 static inline BOOLEAN nCoeff_is_Ring_2toM(const coeffs r)
     737static FORCE_INLINE BOOLEAN nCoeff_is_Ring_2toM(const coeffs r)
    738738{ assume(r != NULL); return (getCoeffType(r)==n_Z2m); }
    739739
    740 static inline BOOLEAN nCoeff_is_Ring_ModN(const coeffs r)
     740static FORCE_INLINE BOOLEAN nCoeff_is_Ring_ModN(const coeffs r)
    741741{ assume(r != NULL); return (getCoeffType(r)==n_Zn); }
    742742
    743 static inline BOOLEAN nCoeff_is_Ring_PtoM(const coeffs r)
     743static FORCE_INLINE BOOLEAN nCoeff_is_Ring_PtoM(const coeffs r)
    744744{ assume(r != NULL); return (getCoeffType(r)==n_Znm); }
    745745
    746 static inline BOOLEAN nCoeff_is_Ring_Z(const coeffs r)
     746static FORCE_INLINE BOOLEAN nCoeff_is_Ring_Z(const coeffs r)
    747747{ assume(r != NULL); return (getCoeffType(r)==n_Z); }
    748748
    749 static inline BOOLEAN nCoeff_is_Ring(const coeffs r)
     749static FORCE_INLINE BOOLEAN nCoeff_is_Ring(const coeffs r)
    750750{ assume(r != NULL); return (r->is_field==0); }
    751751
    752752/// returns TRUE, if r is a field or r has no zero divisors (i.e is a domain)
    753 static inline BOOLEAN nCoeff_is_Domain(const coeffs r)
     753static FORCE_INLINE BOOLEAN nCoeff_is_Domain(const coeffs r)
    754754{
    755755  assume(r != NULL);
     
    765765/// in Z/2^kZ: TRUE iff ((a = 0 mod 2^k) and (b = 0 or b is a power of 2))
    766766///                  or ((a, b <> 0) and (b/gcd(a, b) is odd))
    767 static inline BOOLEAN n_DivBy(number a, number b, const coeffs r)
     767static FORCE_INLINE BOOLEAN n_DivBy(number a, number b, const coeffs r)
    768768{ STATISTIC(n_DivBy); assume(r != NULL);
    769769#ifdef HAVE_RINGS
     
    776776}
    777777
    778 static inline number n_ChineseRemainderSym(number *a, number *b, int rl, BOOLEAN sym,const coeffs r)
     778static FORCE_INLINE number n_ChineseRemainderSym(number *a, number *b, int rl, BOOLEAN sym,const coeffs r)
    779779{ STATISTIC(n_ChineseRemainderSym); assume(r != NULL); assume(r->cfChineseRemainder != NULL); return r->cfChineseRemainder(a,b,rl,sym,r); }
    780780
    781 static inline number n_Farey(number a, number b, const coeffs r)
     781static FORCE_INLINE number n_Farey(number a, number b, const coeffs r)
    782782{ STATISTIC(n_Farey); assume(r != NULL); assume(r->cfFarey != NULL); return r->cfFarey(a,b,r); }
    783783
    784 static inline int n_ParDeg(number n, const coeffs r)
     784static FORCE_INLINE int n_ParDeg(number n, const coeffs r)
    785785{ STATISTIC(n_ParDeg); assume(r != NULL); assume(r->cfParDeg != NULL); return r->cfParDeg(n,r); }
    786786
    787787/// Returns the number of parameters
    788 static inline int n_NumberOfParameters(const coeffs r)
     788static FORCE_INLINE int n_NumberOfParameters(const coeffs r)
    789789{ STATISTIC(n_NumberOfParameters); assume(r != NULL); return r->iNumberOfParameters; }
    790790
    791791/// Returns a (const!) pointer to (const char*) names of parameters
    792 static inline char const * * n_ParameterNames(const coeffs r)
     792static FORCE_INLINE char const * * n_ParameterNames(const coeffs r)
    793793{ STATISTIC(n_ParameterNames); assume(r != NULL); return r->pParameterNames; }
    794794
    795795/// return the (iParameter^th) parameter as a NEW number
    796796/// NOTE: parameter numbering: 1..n_NumberOfParameters(...)
    797 static inline number n_Param(const int iParameter, const coeffs r)
     797static FORCE_INLINE number n_Param(const int iParameter, const coeffs r)
    798798{ assume(r != NULL);
    799799  assume((iParameter >= 1) || (iParameter <= n_NumberOfParameters(r)));
     
    802802}
    803803
    804 static inline number  n_RePart(number i, const coeffs cf)
     804static FORCE_INLINE number  n_RePart(number i, const coeffs cf)
    805805{ STATISTIC(n_RePart); assume(cf != NULL); assume(cf->cfRePart!=NULL); return cf->cfRePart(i,cf); }
    806806
    807 static inline number  n_ImPart(number i, const coeffs cf)
     807static FORCE_INLINE number  n_ImPart(number i, const coeffs cf)
    808808{ STATISTIC(n_ImPart); assume(cf != NULL); assume(cf->cfImPart!=NULL); return cf->cfImPart(i,cf); }
    809809
    810810/// returns TRUE, if r is not a field and r has non-trivial units
    811 static inline BOOLEAN nCoeff_has_Units(const coeffs r)
     811static FORCE_INLINE BOOLEAN nCoeff_has_Units(const coeffs r)
    812812{ assume(r != NULL); return ((getCoeffType(r)==n_Zn) || (getCoeffType(r)==n_Z2m) || (getCoeffType(r)==n_Znm)); }
    813813
    814 static inline BOOLEAN nCoeff_is_Zp(const coeffs r)
     814static FORCE_INLINE BOOLEAN nCoeff_is_Zp(const coeffs r)
    815815{ assume(r != NULL); return getCoeffType(r)==n_Zp; }
    816816
    817 static inline BOOLEAN nCoeff_is_Zp(const coeffs r, int p)
     817static FORCE_INLINE BOOLEAN nCoeff_is_Zp(const coeffs r, int p)
    818818{ assume(r != NULL); return ((getCoeffType(r)==n_Zp) && (r->ch == p)); }
    819819
    820 static inline BOOLEAN nCoeff_is_Q(const coeffs r)
     820static FORCE_INLINE BOOLEAN nCoeff_is_Q(const coeffs r)
    821821{ assume(r != NULL); return getCoeffType(r)==n_Q && (r->is_field); }
    822822
    823 static inline BOOLEAN nCoeff_is_numeric(const coeffs r) /* R, long R, long C */
     823static FORCE_INLINE BOOLEAN nCoeff_is_numeric(const coeffs r) /* R, long R, long C */
    824824{ assume(r != NULL);  return (getCoeffType(r)==n_R) || (getCoeffType(r)==n_long_R) || (getCoeffType(r)==n_long_C); }
    825825// (r->ringtype == 0) && (r->ch ==  -1); ??
    826826
    827 static inline BOOLEAN nCoeff_is_R(const coeffs r)
     827static FORCE_INLINE BOOLEAN nCoeff_is_R(const coeffs r)
    828828{ assume(r != NULL); return getCoeffType(r)==n_R; }
    829829
    830 static inline BOOLEAN nCoeff_is_GF(const coeffs r)
     830static FORCE_INLINE BOOLEAN nCoeff_is_GF(const coeffs r)
    831831{ assume(r != NULL); return getCoeffType(r)==n_GF; }
    832832
    833 static inline BOOLEAN nCoeff_is_GF(const coeffs r, int q)
     833static FORCE_INLINE BOOLEAN nCoeff_is_GF(const coeffs r, int q)
    834834{ assume(r != NULL); return (getCoeffType(r)==n_GF) && (r->ch == q); }
    835835
    836836/* TRUE iff r represents an algebraic or transcendental extension field */
    837 static inline BOOLEAN nCoeff_is_Extension(const coeffs r)
     837static FORCE_INLINE BOOLEAN nCoeff_is_Extension(const coeffs r)
    838838{
    839839  assume(r != NULL);
     
    848848   height above some field of characteristic p (may be Z/pZ or some
    849849   Galois field of characteristic p) */
    850 static inline BOOLEAN nCoeff_is_Zp_a(const coeffs r)
     850static FORCE_INLINE BOOLEAN nCoeff_is_Zp_a(const coeffs r)
    851851{
    852852  assume(r != NULL);
     
    861861   height above some field of characteristic p (may be Z/pZ or some
    862862   Galois field of characteristic p) */
    863 static inline BOOLEAN nCoeff_is_Zp_a(const coeffs r, int p)
     863static FORCE_INLINE BOOLEAN nCoeff_is_Zp_a(const coeffs r, int p)
    864864{
    865865  assume(r != NULL);
     
    874874   actually: TRUE iff the given r is an extension tower of arbitrary
    875875   height above some field of characteristic 0 (may be Q, R, or C) */
    876 static inline BOOLEAN nCoeff_is_Q_a(const coeffs r)
     876static FORCE_INLINE BOOLEAN nCoeff_is_Q_a(const coeffs r)
    877877{
    878878  assume(r != NULL);
     
    883883
    884884
    885 static inline BOOLEAN nCoeff_is_long_R(const coeffs r)
     885static FORCE_INLINE BOOLEAN nCoeff_is_long_R(const coeffs r)
    886886{ assume(r != NULL); return getCoeffType(r)==n_long_R; }
    887887
    888 static inline BOOLEAN nCoeff_is_long_C(const coeffs r)
     888static FORCE_INLINE BOOLEAN nCoeff_is_long_C(const coeffs r)
    889889{ assume(r != NULL); return getCoeffType(r)==n_long_C; }
    890890
    891 static inline BOOLEAN nCoeff_is_CF(const coeffs r)
     891static FORCE_INLINE BOOLEAN nCoeff_is_CF(const coeffs r)
    892892{ assume(r != NULL); return getCoeffType(r)==n_CF; }
    893893
    894894/// TRUE, if the computation of the inverse is fast,
    895895/// i.e. prefer leading coeff. 1 over content
    896 static inline BOOLEAN nCoeff_has_simple_inverse(const coeffs r)
     896static FORCE_INLINE BOOLEAN nCoeff_has_simple_inverse(const coeffs r)
    897897{ assume(r != NULL); return r->has_simple_Inverse; }
    898898
    899899/// TRUE if n_Delete/n_New are empty operations
    900 static inline BOOLEAN nCoeff_has_simple_Alloc(const coeffs r)
     900static FORCE_INLINE BOOLEAN nCoeff_has_simple_Alloc(const coeffs r)
    901901{ assume(r != NULL); return r->has_simple_Alloc; }
    902902
    903903/// TRUE iff r represents an algebraic extension field
    904 static inline BOOLEAN nCoeff_is_algExt(const coeffs r)
     904static FORCE_INLINE BOOLEAN nCoeff_is_algExt(const coeffs r)
    905905{ assume(r != NULL); return (getCoeffType(r)==n_algExt); }
    906906
    907907/// is it an alg. ext. of Q?
    908 static inline BOOLEAN nCoeff_is_Q_algext(const coeffs r)
     908static FORCE_INLINE BOOLEAN nCoeff_is_Q_algext(const coeffs r)
    909909{ assume(r != NULL); return ((n_GetChar(r) == 0) && nCoeff_is_algExt(r)); }
    910910
    911911/// TRUE iff r represents a transcendental extension field
    912 static inline BOOLEAN nCoeff_is_transExt(const coeffs r)
     912static FORCE_INLINE BOOLEAN nCoeff_is_transExt(const coeffs r)
    913913{ assume(r != NULL); return (getCoeffType(r)==n_transExt); }
    914914
     
    923923/// NOTE/TODO: see also the description by Hans
    924924/// TODO: rename into n_ClearIntegerContent
    925 static inline void n_ClearContent(ICoeffsEnumerator& numberCollectionEnumerator, number& c, const coeffs r)
     925static FORCE_INLINE void n_ClearContent(ICoeffsEnumerator& numberCollectionEnumerator, number& c, const coeffs r)
    926926{ STATISTIC(n_ClearContent); assume(r != NULL); r->cfClearContent(numberCollectionEnumerator, c, r); }
    927927
     
    930930/// with which all the number coeffs. were multiplied)
    931931/// NOTE/TODO: see also the description by Hans
    932 static inline void n_ClearDenominators(ICoeffsEnumerator& numberCollectionEnumerator, number& d, const coeffs r)
     932static FORCE_INLINE void n_ClearDenominators(ICoeffsEnumerator& numberCollectionEnumerator, number& d, const coeffs r)
    933933{ STATISTIC(n_ClearDenominators); assume(r != NULL); r->cfClearDenominators(numberCollectionEnumerator, d, r); }
    934934
     
    939939// *p_Content) and p_Cleardenom_n (which doesn't)!!!
    940940
    941 static inline void n_ClearContent(ICoeffsEnumerator& numberCollectionEnumerator, const coeffs r)
     941static FORCE_INLINE void n_ClearContent(ICoeffsEnumerator& numberCollectionEnumerator, const coeffs r)
    942942{ STATISTIC(n_ClearContent); number c; n_ClearContent(numberCollectionEnumerator, c, r); n_Delete(&c, r); }
    943943
    944 static inline void n_ClearDenominators(ICoeffsEnumerator& numberCollectionEnumerator, const coeffs r)
     944static FORCE_INLINE void n_ClearDenominators(ICoeffsEnumerator& numberCollectionEnumerator, const coeffs r)
    945945{ STATISTIC(n_ClearDenominators); assume(r != NULL); number d; n_ClearDenominators(numberCollectionEnumerator, d, r); n_Delete(&d, r); }
    946946
     
    954954/// TODO: make it a virtual method of coeffs, together with:
    955955/// Decompose & Compose, rParameter & rPar
    956 static inline char * nCoeffString(const coeffs cf)
     956static FORCE_INLINE char * nCoeffString(const coeffs cf)
    957957{ STATISTIC(nCoeffString); assume( cf != NULL ); return cf->cfCoeffString(cf); }
    958958
    959959
    960 static inline char * nCoeffName (const coeffs cf)
     960static FORCE_INLINE char * nCoeffName (const coeffs cf)
    961961{ STATISTIC(nCoeffName); assume( cf != NULL ); return cf->cfCoeffName(cf); }
    962962
    963 static inline number n_Random(siRandProc p, number p1, number p2, const coeffs cf)
     963static FORCE_INLINE number n_Random(siRandProc p, number p1, number p2, const coeffs cf)
    964964{ STATISTIC(n_Random); assume( cf != NULL ); assume( cf->cfRandom != NULL );  return cf->cfRandom(p, p1, p2, cf); }
    965965
    966966/// io via ssi:
    967 static inline void n_WriteFd(number a, FILE *f, const coeffs r)
     967static FORCE_INLINE void n_WriteFd(number a, FILE *f, const coeffs r)
    968968{ STATISTIC(n_WriteFd); assume(r != NULL); assume(r->cfWriteFd != NULL); return r->cfWriteFd(a, f, r); }
    969969
    970970/// io via ssi:
    971 static inline number n_ReadFd( s_buff f, const coeffs r)
     971static FORCE_INLINE number n_ReadFd( s_buff f, const coeffs r)
    972972{ STATISTIC(n_ReadFd); assume(r != NULL); assume(r->cfReadFd != NULL); return r->cfReadFd(f, r); }
    973973
    974974
     975// the following wrappers went to numbers.cc since they needed factory
     976// knowledge!
    975977number n_convFactoryNSingN( const CanonicalForm n, const coeffs r);
    976978
Note: See TracChangeset for help on using the changeset viewer.