X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Fnumeric.h;h=68c227d1abacb4948261f61541470575d3694c05;hp=88b7d9537c91f63600c1ddb3cd9c154b974456ff;hb=26741891dadf23162799009b6fd57b4984bd4ce5;hpb=52b8a6451d4d5f32e45e3dbf93c22369fc2f99c2 diff --git a/ginac/numeric.h b/ginac/numeric.h index 88b7d953..68c227d1 100644 --- a/ginac/numeric.h +++ b/ginac/numeric.h @@ -30,7 +30,9 @@ class cl_N; // We want to include cln.h only in numeric.cpp in order to // avoid namespace pollution and keep compile-time low. +#ifndef NO_GINAC_NAMESPACE namespace GiNaC { +#endif // ndef NO_GINAC_NAMESPACE #define HASHVALUE_NUMERIC 0x80000001U @@ -77,6 +79,7 @@ class numeric : public basic friend numeric asinh(numeric const & x); friend numeric acosh(numeric const & x); friend numeric atanh(numeric const & x); + friend numeric zeta(numeric const & x); friend numeric bernoulli(numeric const & n); friend numeric abs(numeric const & x); friend numeric mod(numeric const & a, numeric const & b); @@ -123,9 +126,9 @@ public: // functions overriding virtual functions from bases classes public: basic * duplicate() const; + void print(ostream & os, unsigned precedence=0) const; void printraw(ostream & os) const; void printtree(ostream & os, unsigned indent) const; - void print(ostream & os, unsigned precedence=0) const; void printcsrc(ostream & os, unsigned type, unsigned precedence=0) const; bool info(unsigned inf) const; ex evalf(int level=0) const; @@ -185,6 +188,8 @@ public: bool is_prime(void) const; bool is_rational(void) const; bool is_real(void) const; + bool is_cinteger(void) const; + bool is_crational(void) const; bool operator==(numeric const & other) const; bool operator!=(numeric const & other) const; bool operator<(numeric const & other) const; @@ -241,6 +246,7 @@ numeric acosh(numeric const & x); numeric atanh(numeric const & x); numeric zeta(numeric const & x); numeric gamma(numeric const & x); +numeric psi(numeric const & x); numeric psi(numeric const & n, numeric const & x); numeric factorial(numeric const & n); numeric doublefactorial(numeric const & n); @@ -304,6 +310,12 @@ inline bool is_rational(numeric const & x) inline bool is_real(numeric const & x) { return x.is_real(); } +inline bool is_cinteger(numeric const & x) +{ return x.is_cinteger(); } + +inline bool is_crational(numeric const & x) +{ return x.is_crational(); } + inline numeric real(numeric const & x) { return x.real(); } @@ -316,7 +328,8 @@ inline numeric numer(numeric const & x) inline numeric denom(numeric const & x) { return x.denom(); } -ex IEvalf(void); +// numeric evaluation functions for class constant objects: + ex PiEvalf(void); ex EulerGammaEvalf(void); ex CatalanEvalf(void); @@ -324,9 +337,11 @@ ex CatalanEvalf(void); // utility functions inline const numeric &ex_to_numeric(const ex &e) { - return static_cast(*e.bp); + return static_cast(*e.bp); } +#ifndef NO_GINAC_NAMESPACE } // namespace GiNaC +#endif // ndef NO_GINAC_NAMESPACE #endif // ndef __GINAC_NUMERIC_H__