Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef doubleFloat_H
00027 #define doubleFloat_H
00028
00029 #include <OpenFOAM/label.H>
00030 #include <OpenFOAM/products.H>
00031
00032 #include <cmath>
00033
00034 #ifdef darwin
00035 #ifndef DUMMY_SCALAR_FUNCTIONS
00036 #define DUMMY_SCALAR_FUNCTIONS
00037 inline float j0f(float x) { return float(j0(double(x)));}
00038 inline float j1f(float x) { return float(j1(double(x)));}
00039 inline float y0f(float x) { return float(y0(double(x)));}
00040 inline float y1f(float x) { return float(y1(double(x)));}
00041 inline float jnf(const int n, const float s) { return float(jn(n, double(s))); }
00042 inline float ynf(const int n, const float s) { return float(yn(n, double(s))); }
00043 #endif
00044 #endif
00045
00046
00047
00048 namespace Foam
00049 {
00050
00051
00052
00053 template<class Cmpt>
00054 class typeOfRank<Cmpt, 0>
00055 {
00056 public:
00057
00058 typedef Cmpt type;
00059 };
00060
00061
00062 template<class Cmpt>
00063 class symmTypeOfRank<Cmpt, 0>
00064 {
00065 public:
00066
00067 typedef Cmpt type;
00068 };
00069
00070
00071
00072
00073 template<class T>
00074 inline bool equal(const T& s1, const T& s2)
00075 {
00076 return s1 == s2;
00077 }
00078
00079
00080 #define MAXMINPOW(retType, type1, type2) \
00081 \
00082 MAXMIN(retType, type1, type2) \
00083 \
00084 inline double pow(const type1 s, const type2 e) \
00085 { \
00086 return ::pow(double(s), double(e)); \
00087 }
00088
00089
00090 MAXMINPOW(double, double, double)
00091 MAXMINPOW(double, double, float)
00092 MAXMINPOW(double, float, double)
00093 MAXMINPOW(float, float, float)
00094 MAXMINPOW(double, double, int)
00095 MAXMINPOW(double, int, double)
00096 MAXMINPOW(double, double, long)
00097 MAXMINPOW(double, long, double)
00098 MAXMINPOW(float, float, int)
00099 MAXMINPOW(float, int, float)
00100 MAXMINPOW(float, float, long)
00101 MAXMINPOW(float, long, float)
00102
00103 #undef MAXMINPOW
00104
00105
00106
00107
00108 }
00109
00110
00111
00112 #endif
00113
00114