📄 mathfunc.h
字号:
{ return BZ_CMATHFN_SCOPE(cos)((complex<double> )x); } template<typename T1> static void prettyPrint(BZ_STD_SCOPE(string) &str, prettyPrintFormat& format, const T1& a) { str += "cos("; a.prettyPrint(str,format); str += ")"; }};#endif#ifndef __PGI// cos(complex<long double> )#ifdef BZ_HAVE_COMPLEX_MATH1template<>class _bz_cos<complex<long double> > : public OneOperandApplicativeTemplatesBase {public: typedef complex<long double> T_numtype1; typedef complex<long double> T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_CMATHFN_SCOPE(cos)((complex<long double> )x); } template<typename T1> static void prettyPrint(BZ_STD_SCOPE(string) &str, prettyPrintFormat& format, const T1& a) { str += "cos("; a.prettyPrint(str,format); str += ")"; }};#endif#endif// copysign(P_numtype1, P_numtype2)#ifdef BZ_HAVE_SYSTEM_V_MATHtemplate<typename P_numtype1, typename P_numtype2>class _bz_copysign : public TwoOperandApplicativeTemplatesBase {public: typedef P_numtype1 T_numtype1; typedef P_numtype2 T_numtype2; typedef double T_numtype; static inline T_numtype apply(T_numtype1 x, T_numtype2 y) { return BZ_IEEEMATHFN_SCOPE(copysign)((double)x,(double)y); } template<typename T1, typename T2> static void prettyPrint(BZ_STD_SCOPE(string) &str, prettyPrintFormat& format, const T1& a, const T2& b) { str += "copysign("; a.prettyPrint(str,format); str += ","; b.prettyPrint(str,format); str += ")"; }};#endif// cosh(P_numtype1) Hyperbolic cosinetemplate<typename P_numtype1>class _bz_cosh : public OneOperandApplicativeTemplatesBase {public: typedef P_numtype1 T_numtype1; typedef double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(cosh)((double)x); } template<typename T1> static void prettyPrint(BZ_STD_SCOPE(string) &str, prettyPrintFormat& format, const T1& a) { str += "cosh("; a.prettyPrint(str,format); str += ")"; }};// cosh(float)template<>class _bz_cosh<float> : public OneOperandApplicativeTemplatesBase {public: typedef float T_numtype1; typedef float T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(cosh)((float)x); } template<typename T1> static void prettyPrint(BZ_STD_SCOPE(string) &str, prettyPrintFormat& format, const T1& a) { str += "cosh("; a.prettyPrint(str,format); str += ")"; }};// cosh(long double)template<>class _bz_cosh<long double> : public OneOperandApplicativeTemplatesBase {public: typedef long double T_numtype1; typedef long double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(cosh)((long double)x); } template<typename T1> static void prettyPrint(BZ_STD_SCOPE(string) &str, prettyPrintFormat& format, const T1& a) { str += "cosh("; a.prettyPrint(str,format); str += ")"; }};// cosh(complex<float> )#ifdef BZ_HAVE_COMPLEX_MATH1template<>class _bz_cosh<complex<float> > : public OneOperandApplicativeTemplatesBase {public: typedef complex<float> T_numtype1; typedef complex<float> T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_CMATHFN_SCOPE(cosh)((complex<float> )x); } template<typename T1> static void prettyPrint(BZ_STD_SCOPE(string) &str, prettyPrintFormat& format, const T1& a) { str += "cosh("; a.prettyPrint(str,format); str += ")"; }};#endif// cosh(complex<double> )#ifdef BZ_HAVE_COMPLEX_MATH1template<>class _bz_cosh<complex<double> > : public OneOperandApplicativeTemplatesBase {public: typedef complex<double> T_numtype1; typedef complex<double> T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_CMATHFN_SCOPE(cosh)((complex<double> )x); } template<typename T1> static void prettyPrint(BZ_STD_SCOPE(string) &str, prettyPrintFormat& format, const T1& a) { str += "cosh("; a.prettyPrint(str,format); str += ")"; }};#endif#ifndef __PGI// cosh(complex<long double> )#ifdef BZ_HAVE_COMPLEX_MATH1template<>class _bz_cosh<complex<long double> > : public OneOperandApplicativeTemplatesBase {public: typedef complex<long double> T_numtype1; typedef complex<long double> T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_CMATHFN_SCOPE(cosh)((complex<long double> )x); } template<typename T1> static void prettyPrint(BZ_STD_SCOPE(string) &str, prettyPrintFormat& format, const T1& a) { str += "cosh("; a.prettyPrint(str,format); str += ")"; }};#endif#endif// drem(P_numtype1, P_numtype2) Remainder#ifdef BZ_HAVE_SYSTEM_V_MATHtemplate<typename P_numtype1, typename P_numtype2>class _bz_drem : public TwoOperandApplicativeTemplatesBase {public: typedef P_numtype1 T_numtype1; typedef P_numtype2 T_numtype2; typedef double T_numtype; static inline T_numtype apply(T_numtype1 x, T_numtype2 y) { return BZ_IEEEMATHFN_SCOPE(drem)((double)x,(double)y); } template<typename T1, typename T2> static void prettyPrint(BZ_STD_SCOPE(string) &str, prettyPrintFormat& format, const T1& a, const T2& b) { str += "drem("; a.prettyPrint(str,format); str += ","; b.prettyPrint(str,format); str += ")"; }};#endif// exp(P_numtype1) Exponentialtemplate<typename P_numtype1>class _bz_exp : public OneOperandApplicativeTemplatesBase {public: typedef P_numtype1 T_numtype1; typedef double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(exp)((double)x); } template<typename T1> static void prettyPrint(BZ_STD_SCOPE(string) &str, prettyPrintFormat& format, const T1& a) { str += "exp("; a.prettyPrint(str,format); str += ")"; }};// exp(float)template<>class _bz_exp<float> : public OneOperandApplicativeTemplatesBase {public: typedef float T_numtype1; typedef float T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(exp)((float)x); } template<typename T1> static void prettyPrint(BZ_STD_SCOPE(string) &str, prettyPrintFormat& format, const T1& a) { str += "exp("; a.prettyPrint(str,format); str += ")"; }};// exp(long double)template<>class _bz_exp<long double> : public OneOperandApplicativeTemplatesBase {public: typedef long double T_numtype1; typedef long double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(exp)((long double)x); } template<typename T1> static void prettyPrint(BZ_STD_SCOPE(string) &str, prettyPrintFormat& format, const T1& a) { str += "exp("; a.prettyPrint(str,format); str += ")"; }};// exp(complex<float> )#ifdef BZ_HAVE_COMPLEX_MATH1template<>class _bz_exp<complex<float> > : public OneOperandApplicativeTemplatesBase {public: typedef complex<float> T_numtype1; typedef complex<float> T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_CMATHFN_SCOPE(exp)((complex<float> )x); } template<typename T1> static void prettyPrint(BZ_STD_SCOPE(string) &str, prettyPrintFormat& format, const T1& a) { str += "exp("; a.prettyPrint(str,format); str += ")"; }};#endif// exp(complex<double> )#ifdef BZ_HAVE_COMPLEX_MATH1template<>class _bz_exp<complex<double> > : public OneOperandApplicativeTemplatesBase {public: typedef complex<double> T_numtype1; typedef complex<double> T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_CMATHFN_SCOPE(exp)((complex<double> )x); } template<typename T1> static void prettyPrint(BZ_STD_SCOPE(string) &str, prettyPrintFormat& format, const T1& a) { str += "exp("; a.prettyPrint(str,format); str += ")"; }};#endif#ifndef __PGI// exp(complex<long double> )#ifdef BZ_HAVE_COMPLEX_MATH1template<>class _bz_exp<complex<long double> > : public OneOperandApplicativeTemplatesBase {public: typedef complex<long double> T_numtype1; typedef complex<long double> T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_CMATHFN_SCOPE(exp)((complex<long double> )x); } template<typename T1> static void prettyPrint(BZ_STD_SCOPE(string) &str, prettyPrintFormat& format, const T1& a) { str += "exp("; a.prettyPrint(str,format); str += ")"; }};#endif#endif// expm1(P_numtype1) Exp(x)-1#ifdef BZ_HAVE_IEEE_MATHtemplate<typename P_numtype1>class _bz_expm1 : public OneOperandApplicativeTemplatesBase {public: typedef P_numtype1 T_numtype1; typedef double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_IEEEMATHFN_SCOPE(expm1)((double)x); } template<typename T1> static void prettyPrint(BZ_STD_SCOPE(string) &str, prettyPrintFormat& format, const T1& a) { str += "expm1("; a.prettyPrint(str,format); str += ")"; }};#endif// erf(P_numtype1) Error function#ifdef BZ_HAVE_IEEE_MATHtemplate<typename P_numtype1>class _bz_erf : public OneOperandApplicativeTemplatesBase {public: typedef P_numtype1 T_numtype1; typedef double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_IEEEMATHFN_SCOPE(erf)((double)x); } template<typename T1> static void prettyPrint(BZ_STD_SCOPE(string) &str, prettyPrintFormat& format, const T1& a) { str += "erf("; a.prettyPrint(str,format); str += ")"; }};#endif// erfc(P_numtype1) Complementary error function#ifdef BZ_HAVE_IEEE_MATHtemplate<typename P_numtype1>class _bz_erfc : public OneOperandApplicativeTemplatesBase {public: typedef P_numtype1 T_numtype1; typedef double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_IEEEMATHFN_SCOPE(erfc)((double)x); } template<typename T1> static void prettyPrint(BZ_STD_SCOPE(string) &str, prettyPrintFormat& format, const T1& a) { str += "erfc("; a.prettyPrint(str,format); str += ")"; }};#endif// floor(P_numtype1) Floor functiontemplate<typename P_numtype1>class _bz_floor : public OneOperandApplicativeTemplatesBase {public: typedef P_numtype1 T_numtype1; typedef double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(floor)((double)x); } template<typename T1> static void prettyPrint(BZ_STD_SCOPE(string) &str, prettyPrintFormat& format, const T1& a) { str += "floor("; a.prettyPrint(str,format); str += ")"; }};// floor(float)template<>class _bz_floor<float> : public OneOperandApplicativeTemplatesBase {public: typedef float T_numtype1; typedef float T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(floor)((float)x); } template<typename T1> static void prettyPrint(BZ_STD_SCOPE(string) &str, prettyPrintFormat& format, const T1& a) { str += "floor("; a.prettyPrint(str,format); str += ")"; }};// floor(long double)template<>class _bz_floor<long double> : public OneOperandApplicativeTemplatesBase {public: typedef long double T_numtype1; typedef long double T_numtype; static inline T_numtype apply(T_numtype1 x) { return BZ_MATHFN_SCOPE(floor)((long double)x); } template<typename T1> static void prettyPrint(BZ_STD_SCOPE(string) &str, prettyPrintFormat& format, const T1& a) { str += "floor("; a.prettyPrint(str,format); str += ")"; }};// fmod(P_numtype1, P_numtype2) Modulo remaindertemplate<typename P_numtype1, typename P_numtype2>class _bz_fmod : public TwoOperandApplicativeTemplatesBase {public: typedef P_numtype1 T_numtype1; typedef P_numtype2 T_numtype2; typedef double T_numtype; static inline T_numtype apply(T_numtype1 x, T_numtype2 y) { return BZ_MATHFN_SCOPE(fmod)((double)x,(double)y); } template<typename T1, typename T2> static void prettyPrint(BZ_STD_SCOPE(string) &str, prettyPrintFormat& format, const T1& a, const T2& b) { str += "fmod("; a.prettyPrint(str,format); str += ","; b.prettyPrint(str,format); str += ")"; }};// hypot(P_numtype1, P_numtype2) sqrt(x*x+y*y)#ifdef BZ_HAVE_SYSTEM_V_MATHtemplate<typename P_numtype1, typename P_numtype2>class _bz_hypot : public TwoOperandApplicativeTemplatesBase {public: typedef P_numtype1 T_numtype1; typedef P_numtype2 T_numtype2; typedef double T_numtype;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -