products.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 InNamespace
25  Foam
26 
27 Description
28  Traits classes for inner and outer products of primitives.
29 
30 \*---------------------------------------------------------------------------*/
31 
32 #ifndef products_H
33 #define products_H
34 
35 #include "pTraits.H"
36 
37 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
38 
39 namespace Foam
40 {
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 template<class Cmpt, int rank>
46 {};
47 
48 
49 template<class Cmpt, int rank>
51 {};
52 
53 
54 template<class arg1, class arg2>
55 class typeOfSum
56 {
57 public:
58 
59  typedef arg1 type;
60 };
61 
62 
63 template<class arg1, class arg2>
65 {
66 public:
67 
68  typedef typename typeOfRank
69  <
70  typename pTraits<arg1>::cmptType,
73 };
74 
75 
76 template<class arg1, class arg2>
78 {
79 public:
80 
81  typedef typename typeOfRank
82  <
83  typename pTraits<arg2>::cmptType,
86 };
87 
88 template<class arg1, class arg2>
90 {
91 public:
92 
93  typedef typename typeOfRank
94  <
95  typename pTraits<arg1>::cmptType,
98 };
99 
100 template<class arg1, class arg2>
102 {
103 public:
104 
105  typedef typename pTraits<arg1>::cmptType type;
106 };
107 
108 
109 template<class arg1, int arg2>
111 {
112 public:
113 
114  typedef typename symmTypeOfRank
115  <
116  typename pTraits<arg1>::cmptType,
117  arg2*int(pTraits<arg1>::rank)
119 };
120 
121 
122 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
123 
124 } // End namespace Foam
125 
126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
127 
128 #endif
129 
130 // ************************************************************************* //
typeOfRank< typename pTraits< vector >::cmptType, int(pTraits< vector >::rank)+int(pTraits< Type >::rank)-2 >::type type
Definition: products.H:97
pTraits< arg1 >::cmptType type
Definition: products.H:105
Namespace for OpenFOAM.
typeOfRank< typename pTraits< arg1 >::cmptType, int(pTraits< arg1 >::rank)+int(pTraits< arg2 >::rank) >::type type
Definition: products.H:72
typeOfRank< typename pTraits< arg2 >::cmptType, int(pTraits< arg1 >::rank)+int(pTraits< arg2 >::rank)-1 >::type type
Definition: products.H:85
Traits class for primitives.
Definition: pTraits.H:50
symmTypeOfRank< typename pTraits< arg1 >::cmptType, arg2 *int(pTraits< arg1 >::rank) >::type type
Definition: products.H:118