doubleFloat.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #ifndef doubleFloat_H
27 #define doubleFloat_H
28 
29 #include "label.H"
30 #include "products.H"
31 
32 #include <cmath>
33 
34 #if defined(MSWIN)
35 #define j0f _j0
36 #define j1f _j1
37 #define jnf _jn
38 #define y0f _y0
39 #define y1f _y1
40 #define ynf _yn
41 #elif defined(DARWIN)
42 #define j0f j0
43 #define j1f j1
44 #define jnf jn
45 #define y0f y0
46 #define y1f y1
47 #define ynf yn
48 #endif
49 
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 
52 namespace Foam
53 {
54 
55 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56 
57 template<class Cmpt>
58 class typeOfRank<Cmpt, 0>
59 {
60 public:
61 
62  typedef Cmpt type;
63 };
64 
65 
66 template<class Cmpt>
67 class symmTypeOfRank<Cmpt, 0>
68 {
69 public:
70 
71  typedef Cmpt type;
72 };
73 
74 
75 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
76 
77 template<class T>
78 inline bool equal(const T& s1, const T& s2)
79 {
80  return s1 == s2;
81 }
82 
83 
84 #define MAXMINPOW(retType, type1, type2) \
85  \
86 MAXMIN(retType, type1, type2) \
87  \
88 inline double pow(const type1 s, const type2 e) \
89 { \
90  return ::pow(double(s), double(e)); \
91 }
92 
93 
94 MAXMINPOW(double, double, double)
95 MAXMINPOW(double, double, float)
96 MAXMINPOW(double, float, double)
97 MAXMINPOW(float, float, float)
98 MAXMINPOW(double, double, int)
99 MAXMINPOW(double, int, double)
100 MAXMINPOW(double, double, long)
101 MAXMINPOW(double, long, double)
102 MAXMINPOW(float, float, int)
103 MAXMINPOW(float, int, float)
104 MAXMINPOW(float, float, long)
105 MAXMINPOW(float, long, float)
106 
107 #undef MAXMINPOW
108 
109 
110 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
111 
112 } // End namespace Foam
113 
114 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
115 
116 #endif
117 
118 // ************************************************************************* //
Foam::typeOfRank< Cmpt, 0 >::type
Cmpt type
Definition: doubleFloat.H:62
MAXMINPOW
#define MAXMINPOW(retType, type1, type2)
Definition: doubleFloat.H:84
Foam::T
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Definition: FieldFieldFunctions.C:55
Foam::symmTypeOfRank< Cmpt, 0 >::type
Cmpt type
Definition: doubleFloat.H:71
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::symmTypeOfRank
Definition: products.H:50
Foam::typeOfRank
Definition: products.H:45
label.H
Foam::equal
bool equal(const T &s1, const T &s2)
Definition: doubleFloat.H:78
products.H
Traits classes for inner and outer products of primitives.